uninitialized stuff can lead to _very_ strange results, including being magically resolved
by touching a variable elsewhere in the program.
This should now _finally_ and once-and-for-all fix font formatting issues (if it doesn't, let me know,
then it's caused by something else).
/me goes and sits in a corner now.
checkForHighlight(msg);
+ // FIXME clean up code! (dup)
+
if(msg.flags() & Message::Redirected) {
BufferSettings bufferSettings;
bool inStatus = bufferSettings.value("UserMessagesInStatusBuffer", QVariant(true)).toBool();
if(inStatus) {
b = statusBuffer(msg.bufferInfo().networkId());
if(b) {
- b->appendMsg(msg);
+ b->appendMsg(msg);
} else if(!inQuery && !inCurrent) { // make sure the message get's shown somewhere
- b = buffer(msg.bufferInfo());
- b->appendMsg(msg);
+ b = buffer(msg.bufferInfo());
+ b->appendMsg(msg);
}
}
if(inQuery) {
b = buffer(msg.bufferInfo().bufferId());
if(b) {
- b->appendMsg(msg);
- } else if(!inStatus && !inCurrent) { // make sure the message get's shown somewhere
- b = statusBuffer(msg.bufferInfo().networkId());
- if(!b)
- b = buffer(msg.bufferInfo()); // seems like we have to create the buffer anyways...
- b->appendMsg(msg);
+ b->appendMsg(msg);
+ } else if(!inStatus && !inCurrent) { // make sure the message get's shown somewhere
+ b = statusBuffer(msg.bufferInfo().networkId());
+ if(!b) b = buffer(msg.bufferInfo()); // seems like we have to create the buffer anyways...
+ b->appendMsg(msg);
}
}
BufferId currentId = bufferModel()->currentIndex().data(NetworkModel::BufferIdRole).value<BufferId>();
b = buffer(currentId);
if(b && currentId != msg.bufferInfo().bufferId() && !inQuery) {
- b->appendMsg(msg);
+ b->appendMsg(msg);
} else if(!inStatus && !inQuery) { // make sure the message get's shown somewhere
- b = statusBuffer(msg.bufferInfo().networkId());
- if(!b)
- b = buffer(msg.bufferInfo()); // seems like we have to create the buffer anyways...
- b->appendMsg(msg);
+ b = statusBuffer(msg.bufferInfo().networkId());
+ if(!b) b = buffer(msg.bufferInfo()); // seems like we have to create the buffer anyways...
+ b->appendMsg(msg);
}
}
} else {
*/
ChatLineOld::ChatLineOld(Message m) {
hght = 0;
- //networkName = m.buffer.network();
- //bufferName = m.buffer.buffer();
+
msg = m;
selectionMode = None;
isHighlight = false;
precomputeLine();
}
+QList<ChatLineOld::FormatRange> ChatLineOld::calcFormatRanges(const UiStyle::StyledText &fs) {
+ QTextLayout::FormatRange additional;
+ additional.start = additional.length = 0;
+ return calcFormatRanges(fs, additional);
+}
+
// This function is almost obsolete, since with the new style engine, we already get a list of formats...
// We don't know yet if we keep this implementation of ChatLineOld, so I won't bother making this actually nice.
-QList<ChatLineOld::FormatRange> ChatLineOld::calcFormatRanges(UiStyle::StyledText fs, QTextLayout::FormatRange additional) {
+QList<ChatLineOld::FormatRange> ChatLineOld::calcFormatRanges(const UiStyle::StyledText &_fs,
+ const QTextLayout::FormatRange &additional) {
+ UiStyle::StyledText fs = _fs;
QList<FormatRange> ranges;
if(additional.length > 0) {
}
}
}
+
foreach(QTextLayout::FormatRange f, fs.formats) {
if(f.length <= 0) continue;
FormatRange range;
int selectionStart, selectionEnd;
void formatMsg(Message);
void precomputeLine();
- QList<FormatRange> calcFormatRanges(UiStyle::StyledText, QTextLayout::FormatRange additional = QTextLayout::FormatRange());
+ QList<FormatRange> calcFormatRanges(const UiStyle::StyledText &);
+ QList<FormatRange> calcFormatRanges(const UiStyle::StyledText &, const QTextLayout::FormatRange &additional);
};
#endif
#include "debugconsole.h"
#include "global.h"
+#include "qtuistyle.h"
MainWin::MainWin(QtUi *_gui, QWidget *parent)
: QMainWindow(parent),
sender = sender.left(i);
title += QString(" - %1").arg(sender);
}
- QString text = QtUi::style()->styleString(Message::mircToInternal(msg.text())).text;
UiSettings uiSettings;
if(uiSettings.value("DisplayPopupMessages", QVariant(true)).toBool()) {
+ // FIXME don't invoke style engine for this!
+ QString text = QtUi::style()->styleString(Message::mircToInternal(msg.text())).text;
displayTrayIconMessage(title, text);
}
QTextCharFormat def;
def.setForeground(QBrush("#000000"));
//def.setFont(QFont("Courier", 10));
+ def.font().setFixedPitch(true);
def.font().setStyleHint(QFont::TypeWriter);
_defaultFormats = QVector<QTextCharFormat>(NumFormatTypes, def);
_customFormats = QVector<QTextCharFormat>(NumFormatTypes, QTextFormat().toCharFormat());
}
UiStyle::StyledText UiStyle::styleString(const QString &_s) {
- QString s = _s; // we can't use call-by-value since this seems to maybe screw up Qt's implicit sharing somehow
- // at least invalid formats are created if we do that
- if(s.startsWith(" ")) {}; // and yet some other stupid no-op that seems to fix the font issue on some machines... -_-
+ QString s = _s;
StyledText result;
QList<FormatType> fmtList;
fmtList.append(None);
}
return fmt;
}
-
-
quasselVersion = "0.2.0-alpha5-pre";
quasselDate = "2008-04-03";
- quasselBuild = 695;
+ quasselBuild = 696;
//! Minimum client build number the core needs
clientBuildNeeded = 642;