mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kcontrol: adjust to Katie changes
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
a825be67e9
commit
a4edab463c
7 changed files with 31 additions and 4 deletions
|
@ -664,7 +664,9 @@ void FontInst::updateFontList(bool emitChanges)
|
|||
foundry;
|
||||
quint32 styleVal;
|
||||
int index;
|
||||
#ifndef QT_KATIE
|
||||
qulonglong writingSystems(WritingSystems::instance()->get(list->fonts[i]));
|
||||
#endif
|
||||
FcBool scalable=FcFalse;
|
||||
|
||||
if(FcResultMatch!=FcPatternGetBool(list->fonts[i], FC_SCALABLE, 0, &scalable))
|
||||
|
@ -676,7 +678,9 @@ void FontInst::updateFontList(bool emitChanges)
|
|||
StyleCont::ConstIterator style=(*fam).add(Style(styleVal));
|
||||
FileCont::ConstIterator file=(*style).add(File(fileName, foundry, index));
|
||||
|
||||
#ifndef QT_KATIE
|
||||
(*style).setWritingSystems((*style).writingSystems()|writingSystems);
|
||||
#endif
|
||||
if(scalable)
|
||||
(*style).setScalable();
|
||||
}
|
||||
|
|
|
@ -232,7 +232,9 @@ EFileType check(const QString &file, Family &fam)
|
|||
? FILE_BITMAP : FILE_SCALABLE;
|
||||
|
||||
FC::getDetails(pat, family, style, index, foundry);
|
||||
#ifndef QT_KATIE
|
||||
ws=WritingSystems::instance()->get(pat);
|
||||
#endif
|
||||
FcPatternDestroy(pat);
|
||||
Style st(style, scalable, ws);
|
||||
st.add(File(file, foundry, index));
|
||||
|
|
|
@ -183,6 +183,7 @@ CFontFilter::CFontFilter(QWidget *parent)
|
|||
addAction(CRIT_FILENAME, i18n("File Name"), false);
|
||||
addAction(CRIT_LOCATION, i18n("File Location"), false);
|
||||
|
||||
#ifndef QT_KATIE
|
||||
KSelectAction *wsMenu=new KSelectAction(KIcon(itsPixmaps[CRIT_WS]), i18n("Writing System"), this);
|
||||
itsActions[CRIT_WS]=wsMenu;
|
||||
itsMenu->addAction(itsActions[CRIT_WS]);
|
||||
|
@ -201,6 +202,7 @@ CFontFilter::CFontFilter(QWidget *parent)
|
|||
}
|
||||
sortActions(wsMenu);
|
||||
connect(wsMenu, SIGNAL(triggered(QString)), SLOT(wsChanged(QString)));
|
||||
#endif // QT_KATIE
|
||||
|
||||
setCriteria(CRIT_FAMILY);
|
||||
setStyle(new CFontFilterStyle(this, itsMenuButton->width()));
|
||||
|
@ -281,7 +283,9 @@ void CFontFilter::filterChanged()
|
|||
deselectCurrent((KSelectAction *)itsActions[CRIT_FILETYPE]);
|
||||
deselectCurrent((KSelectAction *)itsActions[CRIT_WS]);
|
||||
setText(QString());
|
||||
#ifndef QT_KATIE
|
||||
itsCurrentWs=QFontDatabase::Any;
|
||||
#endif
|
||||
itsCurrentFileTypes.clear();
|
||||
|
||||
setCriteria(crit);
|
||||
|
@ -314,10 +318,11 @@ void CFontFilter::wsChanged(const QString &writingSystemName)
|
|||
deselectCurrent((KSelectAction *)itsActions[CRIT_FILETYPE]);
|
||||
deselectCurrent(itsActionGroup);
|
||||
|
||||
#ifndef QT_KATIE
|
||||
QAction *act(((KSelectAction *)itsActions[CRIT_WS])->currentAction());
|
||||
|
||||
if(act)
|
||||
itsCurrentWs=(QFontDatabase::WritingSystem)act->data().toInt();
|
||||
#endif
|
||||
itsCurrentCriteria=CRIT_WS;
|
||||
setReadOnly(true);
|
||||
setCriteria(itsCurrentCriteria);
|
||||
|
@ -416,7 +421,11 @@ void CFontFilter::setCriteria(ECriteria crit)
|
|||
itsMenuButton->resize(arrowmap.width(), arrowmap.height());
|
||||
itsCurrentCriteria=crit;
|
||||
|
||||
#ifndef QT_KATIE
|
||||
emit criteriaChanged(crit, ((qulonglong)1) << (int)itsCurrentWs, itsCurrentFileTypes);
|
||||
#else
|
||||
emit criteriaChanged(crit, ((qulonglong)1) << (int)0, itsCurrentFileTypes);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -87,7 +87,9 @@ class CFontFilter : public KLineEdit
|
|||
QLabel *itsMenuButton;
|
||||
QMenu *itsMenu;
|
||||
ECriteria itsCurrentCriteria;
|
||||
#ifndef QT_KATIE
|
||||
QFontDatabase::WritingSystem itsCurrentWs;
|
||||
#endif
|
||||
QStringList itsCurrentFileTypes;
|
||||
QPixmap itsPixmaps[NUM_CRIT];
|
||||
KAction *itsActions[NUM_CRIT];
|
||||
|
|
|
@ -60,10 +60,12 @@ Style::Style(const QDomElement &elem, bool loadFiles)
|
|||
|
||||
itsScalable=!elem.hasAttribute(SCALABLE_ATTR) || elem.attribute(SCALABLE_ATTR)!="false";
|
||||
itsValue=FC::createStyleVal(weight, width, slant);
|
||||
itsWritingSystems=0;
|
||||
|
||||
itsWritingSystems=0;
|
||||
#ifndef QT_KATIE
|
||||
if(elem.hasAttribute(LANGS_ATTR))
|
||||
itsWritingSystems=WritingSystems::instance()->get(elem.attribute(LANGS_ATTR).split(LANG_SEP, QString::SkipEmptyParts));
|
||||
#endif
|
||||
|
||||
if(loadFiles)
|
||||
{
|
||||
|
@ -126,11 +128,11 @@ QString Style::toXml(bool disabled, const QString &family, QTextStream &s) const
|
|||
if(!itsScalable)
|
||||
str+= SCALABLE_ATTR "=\"false\" ";
|
||||
|
||||
#ifndef QT_KATIE
|
||||
QStringList ws(WritingSystems::instance()->getLangs(itsWritingSystems));
|
||||
|
||||
if(ws.count())
|
||||
str+= LANGS_ATTR "=\"" +ws.join(LANG_SEP)+"\" ";
|
||||
|
||||
#endif
|
||||
|
||||
if(1==files.count())
|
||||
str+=(*files.begin())+"/>";
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
#include <fontconfig/fontconfig.h>
|
||||
#include "WritingSystems.h"
|
||||
|
||||
#ifndef QT_KATIE
|
||||
|
||||
namespace KFI
|
||||
{
|
||||
|
||||
|
@ -174,3 +176,5 @@ WritingSystems::WritingSystems()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // QT_KATIE
|
|
@ -28,6 +28,8 @@
|
|||
#include <QtCore/QStringList>
|
||||
#include "kfontinst_export.h"
|
||||
|
||||
#ifndef QT_KATIE
|
||||
|
||||
namespace KFI
|
||||
{
|
||||
|
||||
|
@ -50,4 +52,6 @@ class KFONTINST_EXPORT WritingSystems
|
|||
|
||||
}
|
||||
|
||||
#endif // QT_KATIE
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue