Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for Qt 2.x again

  • Loading branch information...
commit af675eb602a85549c566a171ff907c38196ef821 1 parent 7cfbe22
Dirk Mueller authored
Showing with 32 additions and 0 deletions.
  1. +17 −0 qt-gui/src/mainwin.cpp
  2. +15 −0 qt-gui/src/optionsdlg.cpp
View
17 qt-gui/src/mainwin.cpp
@@ -297,14 +297,22 @@ CMainWindow::CMainWindow(CICQDaemon *theDaemon, CSignalManager *theSigMan,
#endif
if (strcmp(szTemp, "default") != 0)
{
+#if QT_VERSION >= 300
f.fromString(szTemp);
+#else
+ f.setRawName(szTemp);
+#endif
qApp->setFont(f, true);
}
licqConf.ReadStr("EditFont", szTemp, "default");
if(!strcmp(szTemp, "default"))
f = qApp->font();
else
+#if QT_VERSION >= 300
f.fromString(szTemp);
+#else
+ f.setRawName(szTemp);
+#endif
delete MLEditWrap::editFont;
MLEditWrap::editFont = new QFont(f);
@@ -2309,12 +2317,21 @@ void CMainWindow::saveOptions()
licqConf.SetSection("appearance");
licqConf.WriteStr("Skin", skin->szSkinName);
licqConf.WriteStr("Icons", m_szIconSet);
+#if QT_VERSION >= 300
licqConf.WriteStr("Font", qApp->font() == defaultFont ?
"default" : qApp->font().toString().latin1());
licqConf.WriteStr("EditFont",
(MLEditWrap::editFont == NULL ||
*MLEditWrap::editFont == defaultFont) ?
"default" : MLEditWrap::editFont->toString().latin1());
+#else
+ licqConf.WriteStr("Font", qApp->font() == defaultFont ?
+ "default" : qApp->font().rawName().latin1());
+ licqConf.WriteStr("EditFont",
+ (MLEditWrap::editFont == NULL ||
+ *MLEditWrap::editFont == defaultFont) ?
+ "default" : MLEditWrap::editFont->rawName().latin1());
+#endif
licqConf.WriteBool("GridLines", m_bGridLines);
licqConf.WriteBool("FontStyles", m_bFontStyles);
licqConf.WriteNum("Flash", (unsigned short)m_nFlash);
View
15 qt-gui/src/optionsdlg.cpp
@@ -370,13 +370,21 @@ void OptionsDlg::ApplyOptions()
{
QFont f(mainwin->defaultFont);
if(edtEditFont->text().find(tr("default"), 0, false) != 0)
+#if QT_VERSION >= 300
f.fromString(edtEditFont->text());
+#else
+ f.setRawName(edtEditFont->text());
+#endif
delete MLEditWrap::editFont;
MLEditWrap::editFont = new QFont(f);
f = mainwin->defaultFont;
if(edtFont->text().find(tr("default"), 0, false) != 0)
+#if QT_VERSION >= 300
f.fromString(edtFont->text());
+#else
+ f.setRawName(edtFont->text());
+#endif
qApp->setFont(f, true);
mainwin->m_bGridLines = chkGridLines->isChecked();
@@ -556,10 +564,17 @@ void OptionsDlg::ApplyOptions()
void OptionsDlg::setupFontName(QLineEdit* le, const QFont& font)
{
QString s;
+#if QT_VERSION >= 300
if (font == mainwin->defaultFont)
s = tr("default (%1)").arg(font.toString());
else
s = font.toString();
+#else
+ if (font == mainwin->defaultFont)
+ s = tr("default (%1)").arg(font.rawName());
+ else
+ s = font.rawName();
+#endif
le->setFont(font);
le->setText(s);
le->setCursorPosition(0);
Please sign in to comment.
Something went wrong with that request. Please try again.