summaryrefslogtreecommitdiffstats
path: root/common/config_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/config_file.c')
-rw-r--r--common/config_file.c338
1 files changed, 169 insertions, 169 deletions
diff --git a/common/config_file.c b/common/config_file.c
index 7174286..98948ab 100644
--- a/common/config_file.c
+++ b/common/config_file.c
@@ -1,5 +1,5 @@
/*
- QtCurve (C) Craig Drummond, 2003 - 2010 [email protected]
+ TQtCurve (C) Craig Drummond, 2003 - 2010 [email protected]
----
@@ -43,17 +43,17 @@
#ifdef __cplusplus
-#if QT_VERSION >= 0x040000
-#include <QMap>
-#include <QFile>
-#include <QTextStream>
+#if 0x039999 >= 0x040000
+#include <TQMap>
+#include <TQFile>
+#include <TQTextStream>
#define TO_LATIN1(A) A.toLatin1().constData()
#else
#define TO_LATIN1(A) A.latin1()
-#include <qmap.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqmap.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#endif
#endif // __cplusplus
@@ -181,7 +181,7 @@ static EAppearance toAppearance(const char *str, EAppearance def, EAppAllow allo
if(0==memcmp(str, "glass", 5) || 0==memcmp(str, "shinyglass", 10))
return APPEARANCE_SHINY_GLASS;
if(0==memcmp(str, "agua", 4))
-#if defined __cplusplus && !defined CONFIG_DIALOG && defined QT_VERSION && QT_VERSION < 0x040000
+#if defined __cplusplus && !defined CONFIG_DIALOG && 0x039999 < 0x040000
return APPEARANCE_AGUA_MOD;
#else
return APPEARANCE_AGUA;
@@ -488,7 +488,7 @@ static EAlign toAlign(const char *str, EAlign def)
}
#endif
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
static ETitleBarIcon toTitlebarIcon(const char *str, ETitleBarIcon def)
{
if(str)
@@ -515,7 +515,7 @@ static EImageType toImageType(const char *str, EImageType def)
if(0==memcmp(str, "rings", 5))
return IMG_BORDERED_RINGS;
if(0==memcmp(str, "squarerings", 11))
- return IMG_SQUARE_RINGS;
+ return IMG_STQUARE_RINGS;
if(0==memcmp(str, "file", 4))
return IMG_FILE;
}
@@ -569,41 +569,41 @@ static const char * getHome()
#ifdef __cplusplus
-#if defined QTC_QT_ONLY || QT_VERSION < 0x040000
-#if QT_VERSION < 0x040000
-#include <qdir.h>
-#include <qfile.h>
+#if defined TQTC_TQT_ONLY || 0x039999 < 0x040000
+#if 0x039999 < 0x040000
+#include <tqdir.h>
+#include <tqfile.h>
#endif
// Take from KStandardDirs::makeDir
-static bool makeDir(const QString& dir, int mode)
+static bool makeDir(const TQString& dir, int mode)
{
// we want an absolute path
- if (QDir::isRelativePath(dir))
+ if (TQDir::isRelativePath(dir))
return false;
-#ifdef Q_WS_WIN
- return QDir().mkpath(dir);
+#ifdef TQ_WS_WIN
+ return TQDir().mkpath(dir);
#else
- QString target = dir;
+ TQString target = dir;
uint len = target.length();
// append trailing slash if missing
if (dir.at(len - 1) != '/')
target += '/';
- QString base;
+ TQString base;
uint i = 1;
while( i < len )
{
struct stat st;
-#if QT_VERSION >= 0x040000
+#if 0x039999 >= 0x040000
int pos = target.indexOf('/', i);
#else
- int pos = target.find('/', i);
+ int pos = target.tqfind('/', i);
#endif
base += target.mid(i - 1, pos - i + 1);
- QByteArray baseEncoded = QFile::encodeName(base);
+ TQByteArray baseEncoded = TQFile::encodeName(base);
// bail out if we encountered a problem
if (stat(baseEncoded, &st) != 0)
{
@@ -614,11 +614,11 @@ static bool makeDir(const QString& dir, int mode)
if (mkdir(baseEncoded, static_cast<mode_t>(mode)) != 0)
{
-#if QT_VERSION >= 0x040000
+#if 0x039999 >= 0x040000
baseEncoded.prepend("trying to create local folder ");
perror(baseEncoded.constData());
#else
- perror("trying to create QtCurve config folder ");
+ perror("trying to create TQtCurve config folder ");
#endif
return false; // Couldn't create it :-(
}
@@ -697,7 +697,7 @@ static const char *qtcConfDir()
if(0!=lstat(cfgDir, &info))
{
#ifdef __cplusplus
-#if defined QTC_QT_ONLY || QT_VERSION < 0x040000
+#if defined TQTC_TQT_ONLY || 0x039999 < 0x040000
makeDir(cfgDir, 0755);
#else
KStandardDirs::makeDir(cfgDir, 0755);
@@ -725,16 +725,16 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
if(-1==sizes.titleHeight || force)
{
#ifdef __cplusplus
- QFile f(qtcConfDir()+QString(BORDER_SIZE_FILE));
+ TQFile f(qtcConfDir()+TQString(BORDER_SIZE_FILE));
-#if QT_VERSION >= 0x040000
- if(f.open(QIODevice::ReadOnly))
+#if 0x039999 >= 0x040000
+ if(f.open(TQIODevice::ReadOnly))
#else
if(f.open(IO_ReadOnly))
#endif
{
- QTextStream stream(&f);
- QString line;
+ TQTextStream stream(&f);
+ TQString line;
sizes.titleHeight=stream.readLine().toInt();
sizes.toolTitleHeight=stream.readLine().toInt();
@@ -770,7 +770,7 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
return sizes.titleHeight<12 ? def : sizes;
}
-#if (!defined QT_VERSION || QT_VERSION >= 0x040000) && !defined CONFIG_DIALOG
+#if (0x039999 >= 0x040000) && !defined CONFIG_DIALOG
#define MENU_FILE_PREFIX "menubar-"
#define STATUS_FILE_PREFIX "statusbar-"
@@ -781,17 +781,17 @@ static WindowBorders qtcGetWindowBorderSize(bool force)
#define qtcSetStatusBarHidden(A, H) qtcSetBarHidden((A), (H), STATUS_FILE_PREFIX)
#ifdef __cplusplus
-static bool qtcBarHidden(const QString &app, const char *prefix)
+static bool qtcBarHidden(const TQString &app, const char *prefix)
{
- return QFile::exists(QFile::decodeName(qtcConfDir())+prefix+app);
+ return TQFile::exists(TQFile::decodeName(qtcConfDir())+prefix+app);
}
-static void qtcSetBarHidden(const QString &app, bool hidden, const char *prefix)
+static void qtcSetBarHidden(const TQString &app, bool hidden, const char *prefix)
{
if(!hidden)
- QFile::remove(QFile::decodeName(qtcConfDir())+prefix+app);
+ TQFile::remove(TQFile::decodeName(qtcConfDir())+prefix+app);
else
- QFile(QFile::decodeName(qtcConfDir())+prefix+app).open(QIODevice::WriteOnly);
+ TQFile(TQFile::decodeName(qtcConfDir())+prefix+app).open(TQIODevice::WriteOnly);
}
#else // __cplusplus
@@ -839,7 +839,7 @@ static void qtcSetBarHidden(const char *app, bool hidden, const char *prefix)
#include <QtSvg/QSvgRenderer>
#endif // __cplusplus
-static void loadBgndImage(QtCImage *img)
+static void loadBgndImage(TQtCImage *img)
{
if(!img->loaded &&
img->width>16 && img->width<1024 && img->height>16 && img->height<1024)
@@ -848,13 +848,13 @@ static void loadBgndImage(QtCImage *img)
#ifdef __cplusplus
if(!img->file.isEmpty())
{
- QSvgRenderer svg(img->file);
+ TQSvgRenderer svg(img->file);
if(svg.isValid())
{
- img->pix=QPixmap(img->width, img->height);
- img->pix.fill(Qt::transparent);
- QPainter painter(&img->pix);
+ img->pix=TQPixmap(img->width, img->height);
+ img->pix.fill(TQt::transparent);
+ TQPainter painter(&img->pix);
svg.render(&painter);
painter.end();
}
@@ -867,7 +867,7 @@ static void loadBgndImage(QtCImage *img)
}
}
-#endif // (!defined QT_VERSION || QT_VERSION >= 0x040000) && !defined CONFIG_DIALOG
+#endif // (!defined 0x039999 || 0x039999 >= 0x040000) && !defined CONFIG_DIALOG
#ifdef CONFIG_READ
@@ -885,41 +885,41 @@ static void checkColor(EShade *s, color *c)
#ifdef __cplusplus
-class QtCConfig
+class TQtCConfig
{
public:
- QtCConfig(const QString &filename);
+ TQtCConfig(const TQString &filename);
bool ok() const { return values.count()>0; }
- bool hasKey(const QString &key) { return values.contains(key); }
- const QString & readEntry(const QString &key, const QString &def=QString::null);
+ bool hasKey(const TQString &key) { return values.tqcontains(key); }
+ const TQString & readEntry(const TQString &key, const TQString &def=TQString());
private:
- QMap<QString, QString> values;
+ TQMap<TQString, TQString> values;
};
-QtCConfig::QtCConfig(const QString &filename)
+TQtCConfig::TQtCConfig(const TQString &filename)
{
- QFile f(filename);
+ TQFile f(filename);
-#if QT_VERSION >= 0x040000
- if(f.open(QIODevice::ReadOnly))
+#if 0x039999 >= 0x040000
+ if(f.open(TQIODevice::ReadOnly))
#else
if(f.open(IO_ReadOnly))
#endif
{
- QTextStream stream(&f);
- QString line;
+ TQTextStream stream(&f);
+ TQString line;
while(!stream.atEnd())
{
line = stream.readLine();
-#if QT_VERSION >= 0x040000
+#if 0x039999 >= 0x040000
int pos=line.indexOf('=');
#else
- int pos=line.find('=');
+ int pos=line.tqfind('=');
#endif
if(-1!=pos)
values[line.left(pos)]=line.mid(pos+1);
@@ -928,26 +928,26 @@ QtCConfig::QtCConfig(const QString &filename)
}
}
-inline const QString & QtCConfig::readEntry(const QString &key, const QString &def)
+inline const TQString & TQtCConfig::readEntry(const TQString &key, const TQString &def)
{
- return values.contains(key) ? values[key] : def;
+ return values.tqcontains(key) ? values[key] : def;
}
-inline QString readStringEntry(QtCConfig &cfg, const QString &key)
+inline TQString readStringEntry(TQtCConfig &cfg, const TQString &key)
{
return cfg.readEntry(key);
}
-static int readNumEntry(QtCConfig &cfg, const QString &key, int def)
+static int readNumEntry(TQtCConfig &cfg, const TQString &key, int def)
{
- const QString &val(readStringEntry(cfg, key));
+ const TQString &val(readStringEntry(cfg, key));
return val.isEmpty() ? def : val.toInt();
}
-static int readVersionEntry(QtCConfig &cfg, const QString &key)
+static int readVersionEntry(TQtCConfig &cfg, const TQString &key)
{
- const QString &val(readStringEntry(cfg, key));
+ const TQString &val(readStringEntry(cfg, key));
int major, minor, patch;
return !val.isEmpty() && 3==sscanf(TO_LATIN1(val), "%d.%d.%d", &major, &minor, &patch)
@@ -955,25 +955,25 @@ static int readVersionEntry(QtCConfig &cfg, const QString &key)
: 0;
}
-static bool readBoolEntry(QtCConfig &cfg, const QString &key, bool def)
+static bool readBoolEntry(TQtCConfig &cfg, const TQString &key, bool def)
{
- const QString &val(readStringEntry(cfg, key));
+ const TQString &val(readStringEntry(cfg, key));
return val.isEmpty() ? def : (val=="true" ? true : false);
}
-static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int count)
+static void readDoubleList(TQtCConfig &cfg, const char *key, double *list, int count)
{
-#if (defined QT_VERSION && (QT_VERSION >= 0x040000))
- QStringList strings(readStringEntry(cfg, key).split(',', QString::SkipEmptyParts));
+#if ( (0x039999 >= 0x040000))
+ TQStringList strings(readStringEntry(cfg, key).split(',', TQString::SkipEmptyParts));
#else
- QStringList strings(QStringList::split(',', readStringEntry(cfg, key)));
+ TQStringList strings(TQStringList::split(',', readStringEntry(cfg, key)));
#endif
bool ok(count==strings.size());
if(ok)
{
- QStringList::ConstIterator it(strings.begin());
+ TQStringList::ConstIterator it(strings.begin());
int i;
for(i=0; i<count && ok; ++i, ++it)
@@ -986,7 +986,7 @@ static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int co
#define CFG_READ_COLOR(ENTRY) \
{ \
- QString sVal(cfg.readEntry(#ENTRY)); \
+ TQString sVal(cfg.readEntry(#ENTRY)); \
if(sVal.isEmpty()) \
opts->ENTRY=def->ENTRY; \
else \
@@ -999,7 +999,7 @@ static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int co
opts->ENTRY.loaded=false; \
if(IMG_FILE==opts->ENTRY.type) \
{ \
- QString file(cfg.readEntry(#ENTRY ".file")); \
+ TQString file(cfg.readEntry(#ENTRY ".file")); \
if(!file.isEmpty()) \
{ \
opts->ENTRY.file=file; \
@@ -1009,17 +1009,17 @@ static void readDoubleList(QtCConfig &cfg, const char *key, double *list, int co
} \
}
-#if QT_VERSION >= 0x040000
+#if 0x039999 >= 0x040000
#define CFG_READ_STRING_LIST(ENTRY) \
{ \
- QString val=readStringEntry(cfg, #ENTRY); \
- Strings set=val.isEmpty() ? Strings() : Strings::fromList(val.split(",", QString::SkipEmptyParts)); \
+ TQString val=readStringEntry(cfg, #ENTRY); \
+ Strings set=val.isEmpty() ? Strings() : Strings::fromList(val.split(",", TQString::SkipEmptyParts)); \
opts->ENTRY=set.count() || cfg.hasKey(#ENTRY) ? set : def->ENTRY; \
}
#else
#define CFG_READ_STRING_LIST(ENTRY) \
{ \
- QString val=readStringEntry(cfg, #ENTRY); \
+ TQString val=readStringEntry(cfg, #ENTRY); \
Strings list=val.isEmpty() ? Strings() : Strings::split(",", val, false); \
opts->ENTRY=list.count() || cfg.hasKey(#ENTRY) ? list : def->ENTRY; \
}
@@ -1266,7 +1266,7 @@ static void readDoubleList(GHashTable *cfg, char *key, double *list, int count)
opts->ENTRY=toAlign(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#endif
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
#define CFG_READ_TB_ICON(ENTRY) \
opts->ENTRY=toTitlebarIcon(TO_LATIN1(readStringEntry(cfg, #ENTRY)), def->ENTRY);
#endif
@@ -1325,7 +1325,7 @@ static void copyOpts(Options *src, Options *dest)
dest->noBgndOpacityApps=src->noBgndOpacityApps;
dest->noMenuBgndOpacityApps=src->noMenuBgndOpacityApps;
dest->noBgndImageApps=src->noBgndImageApps;
-#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
+#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
dest->noDlgFixApps=src->noDlgFixApps;
src->noDlgFixApps=NULL;
#endif
@@ -1351,7 +1351,7 @@ static void freeOpts(Options *opts)
g_strfreev(opts->noMenuBgndOpacityApps);
if(opts->noBgndImageApps)
g_strfreev(opts->noBgndImageApps);
-#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
+#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
if(opts->noDlgFixApps)
g_strfreev(opts->noDlgFixApps);
opts->noDlgFixApps=NULL
@@ -1480,7 +1480,7 @@ static void checkConfig(Options *opts)
if(opts->gbFactor<MIN_GB_FACTOR || opts->gbFactor>MAX_GB_FACTOR)
opts->gbFactor=DEF_GB_FACTOR;
-#if defined __cplusplus && defined QT_VERSION && QT_VERSION < 0x040000 && !defined CONFIG_DIALOG
+#if defined __cplusplus && 0x039999 < 0x040000 && !defined CONFIG_DIALOG
opts->crSize=CR_SMALL_SIZE;
if(SLIDER_CIRCULAR==opts->sliderStyle)
opts->sliderStyle=SLIDER_ROUND;
@@ -1497,7 +1497,7 @@ static void checkConfig(Options *opts)
opts->colorMenubarMouseOver=true;
*/
-#if defined __cplusplus && defined QT_VERSION && QT_VERSION < 0x040000 && !defined CONFIG_DIALOG
+#if defined __cplusplus && 0x039999 < 0x040000 && !defined CONFIG_DIALOG
if(opts->round>ROUND_FULL)
opts->round=ROUND_FULL;
#endif
@@ -1528,7 +1528,7 @@ static void checkConfig(Options *opts)
opts->coloredTbarMo=true;
if(opts->round<ROUND_SLIGHT)
- opts->square|=SQUARE_POPUP_MENUS|SQUARE_TOOLTIPS;
+ opts->square|=STQUARE_POPUP_MENUS|STQUARE_TOOLTIPS;
#endif
if(opts->bgndOpacity<0 || opts->bgndOpacity>100)
@@ -1554,7 +1554,7 @@ static void checkConfig(Options *opts)
opts->activeTabAppearance=MODIFY_AGUA(opts->activeTabAppearance);
opts->menuitemAppearance=MODIFY_AGUA(opts->menuitemAppearance);
- if(!opts->borderProgress && (!opts->fillProgress || !(opts->square&SQUARE_PROGRESS)))
+ if(!opts->borderProgress && (!opts->fillProgress || !(opts->square&STQUARE_PROGRESS)))
opts->borderProgress=true;
opts->titlebarAppearance=MODIFY_AGUA(opts->titlebarAppearance);
@@ -1567,7 +1567,7 @@ static void checkConfig(Options *opts)
opts->lighterPopupMenuBgnd=0;
#ifdef __cplusplus
-#if defined QT_VERSION && QT_VERSION >= 0x040000
+#if 0x039999 >= 0x040000
if(!(opts->titlebarButtons&TITLEBAR_BUTTON_ROUND))
#endif
opts->titlebarButtonAppearance=MODIFY_AGUA(opts->titlebarButtonAppearance);
@@ -1591,7 +1591,7 @@ static void checkConfig(Options *opts)
}
#ifdef __cplusplus
-static bool readConfig(const QString &file, Options *opts, Options *defOpts=0L)
+static bool readConfig(const TQString &file, Options *opts, Options *defOpts=0L)
#else
static bool readConfig(const char *file, Options *opts, Options *defOpts)
#endif
@@ -1599,7 +1599,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#ifdef __cplusplus
if(file.isEmpty())
{
- const char *env=getenv("QTCURVE_CONFIG_FILE");
+ const char *env=getenv("TQTCURVE_CONFIG_FILE");
if(NULL!=env)
return readConfig(env, opts, defOpts);
@@ -1609,10 +1609,10 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
if(cfgDir)
{
- QString filename(QFile::decodeName(cfgDir)+CONFIG_FILE);
+ TQString filename(TQFile::decodeName(cfgDir)+CONFIG_FILE);
- if(!QFile::exists(filename))
- filename=QFile::decodeName(cfgDir)+"../"OLD_CONFIG_FILE;
+ if(!TQFile::exists(filename))
+ filename=TQFile::decodeName(cfgDir)+"../"OLD_CONFIG_FILE;
return readConfig(filename, opts, defOpts);
}
}
@@ -1620,7 +1620,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#else
if(!file)
{
- const char *env=getenv("QTCURVE_CONFIG_FILE");
+ const char *env=getenv("TQTCURVE_CONFIG_FILE");
if(NULL!=env)
return readConfig(env, opts, defOpts);
@@ -1646,7 +1646,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
else
{
#ifdef __cplusplus
- QtCConfig cfg(file);
+ TQtCConfig cfg(file);
if(cfg.ok())
{
@@ -1676,7 +1676,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
#else
Options newOpts;
Options *def=&newOpts;
-#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
+#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
opts->noDlgFixApps=NULL;
#endif
opts->noBgndGradientApps=opts->noBgndOpacityApps=opts->noMenuBgndOpacityApps=opts->noBgndImageApps=opts->noMenuStripeApps=NULL;
@@ -1724,18 +1724,18 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
if(opts->version<MAKE_VERSION(1, 4))
{
opts->square=
- (readBoolEntry(cfg, "squareLvSelection", def->square&SQUARE_LISTVIEW_SELECTION) ? SQUARE_LISTVIEW_SELECTION : SQUARE_NONE)+
- (readBoolEntry(cfg, "squareScrollViews", def->square&SQUARE_SCROLLVIEW) ? SQUARE_SCROLLVIEW : SQUARE_NONE)+
- (readBoolEntry(cfg, "squareProgress", def->square&SQUARE_PROGRESS) ? SQUARE_PROGRESS : SQUARE_NONE)+
- (readBoolEntry(cfg, "squareEntry", def->square&SQUARE_ENTRY)? SQUARE_ENTRY : SQUARE_NONE);
+ (readBoolEntry(cfg, "squareLvSelection", def->square&STQUARE_LISTVIEW_SELECTION) ? STQUARE_LISTVIEW_SELECTION : STQUARE_NONE)+
+ (readBoolEntry(cfg, "squareScrollViews", def->square&STQUARE_SCROLLVIEW) ? STQUARE_SCROLLVIEW : STQUARE_NONE)+
+ (readBoolEntry(cfg, "squareProgress", def->square&STQUARE_PROGRESS) ? STQUARE_PROGRESS : STQUARE_NONE)+
+ (readBoolEntry(cfg, "squareEntry", def->square&STQUARE_ENTRY)? STQUARE_ENTRY : STQUARE_NONE);
}
else
CFG_READ_INT(square)
if(opts->version<MAKE_VERSION(1, 6))
- opts->square|=SQUARE_TOOLTIPS;
+ opts->square|=STQUARE_TOOLTIPS;
if(opts->version<MAKE_VERSION3(1, 6, 1))
- opts->square|=SQUARE_POPUP_MENUS;
+ opts->square|=STQUARE_POPUP_MENUS;
if(opts->version<MAKE_VERSION(1, 2))
def->crSize=CR_SMALL_SIZE;
if(opts->version<MAKE_VERSION(1, 0))
@@ -1747,7 +1747,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
def->crHighlight=0;
#ifdef __cplusplus
def->dwtAppearance=APPEARANCE_FLAT;
-#if defined QT_VERSION && (QT_VERSION >= 0x040000)
+#if (0x039999 >= 0x040000)
def->dwtSettings=0;
#endif
#endif
@@ -1761,7 +1761,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
def->etchEntry=true;
def->gtkScrollViews=false;
def->thinSbarGroove=false;
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
def->titlebarButtons=TITLEBAR_BUTTON_HOVER_FRAME;
def->titlebarIcon=TITLEBAR_ICON_MENU_BUTTON;
#endif
@@ -1846,7 +1846,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_GRAD_TYPE(bgndGrad)
CFG_READ_GRAD_TYPE(menuBgndGrad)
CFG_READ_APPEARANCE(menuBgndAppearance, APP_ALLOW_STRIPED)
-#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
+#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
CFG_READ_BOOL(fixParentlessDialogs)
CFG_READ_STRING_LIST(noDlgFixApps)
#endif
@@ -1929,7 +1929,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_BOOL(darkerBorders)
CFG_READ_BOOL(vArrows)
CFG_READ_BOOL(xCheck)
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000)) || !defined __cplusplus
CFG_READ_BOOL(fadeLines)
CFG_READ_GLOW(glowProgress)
#endif
@@ -1966,12 +1966,12 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_INT_BOOL(windowDrag, WM_DRAG_MENUBAR)
CFG_READ_BOOL(shadePopupMenu)
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
CFG_READ_BOOL(stdBtnSizes)
CFG_READ_INT(titlebarButtons)
CFG_READ_TB_ICON(titlebarIcon)
#endif
-#if defined QT_VERSION && (QT_VERSION >= 0x040000)
+#if (0x039999 >= 0x040000)
CFG_READ_BOOL(xbar)
CFG_READ_INT(dwtSettings)
#endif
@@ -2001,10 +2001,10 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_INT(expanderHighlight)
CFG_READ_BOOL(mapKdeIcons)
#endif
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000)) || !defined __cplusplus
CFG_READ_BOOL(gtkButtonOrder)
#endif
-#if !defined __cplusplus || (defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if !defined __cplusplus || (defined CONFIG_DIALOG && (0x039999 >= 0x040000))
CFG_READ_BOOL(reorderGtkButtons)
#endif
CFG_READ_APPEARANCE(titlebarAppearance, APP_ALLOW_NONE)
@@ -2022,7 +2022,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
opts->inactiveTitlebarAppearance=APPEARANCE_FLAT;
#ifdef __cplusplus
CFG_READ_APPEARANCE(titlebarButtonAppearance, APP_ALLOW_BASIC)
-#if defined QT_VERSION && (QT_VERSION >= 0x040000)
+#if (0x039999 >= 0x040000)
if(opts->xbar && opts->menubarHiding)
opts->xbar=false;
#endif
@@ -2031,16 +2031,16 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
CFG_READ_IMAGE(bgndImage)
CFG_READ_IMAGE(menuBgndImage)
CFG_READ_STRING_LIST(noMenuStripeApps)
-#if !defined __cplusplus || (defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if !defined __cplusplus || ( (0x039999 >= 0x040000))
CFG_READ_STRING_LIST(noBgndGradientApps)
CFG_READ_STRING_LIST(noBgndOpacityApps)
CFG_READ_STRING_LIST(noMenuBgndOpacityApps)
CFG_READ_STRING_LIST(noBgndImageApps)
#endif
-#if defined QT_VERSION && (QT_VERSION >= 0x040000)
+#if (0x039999 >= 0x040000)
CFG_READ_STRING_LIST(menubarApps)
CFG_READ_STRING_LIST(statusbarApps)
- CFG_READ_STRING_LIST(useQtFileDialogApps)
+ CFG_READ_STRING_LIST(useTQtFileDialogApps)
CFG_READ_STRING_LIST(windowDragWhiteList)
CFG_READ_STRING_LIST(windowDragBlackList)
#endif
@@ -2048,22 +2048,22 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
readDoubleList(cfg, "customAlphas", opts->customAlphas, NUM_STD_ALPHAS);
#ifdef __cplusplus
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
if(opts->titlebarButtons&TITLEBAR_BUTTON_COLOR || opts->titlebarButtons&TITLEBAR_BUTTON_ICON_COLOR)
{
-#if (defined QT_VERSION && (QT_VERSION >= 0x040000))
- QStringList cols(readStringEntry(cfg, "titlebarButtonColors").split(',', QString::SkipEmptyParts));
+#if ( (0x039999 >= 0x040000))
+ TQStringList cols(readStringEntry(cfg, "titlebarButtonColors").split(',', TQString::SkipEmptyParts));
#else
- QStringList cols(QStringList::split(',', readStringEntry(cfg, "titlebarButtonColors")));
+ TQStringList cols(TQStringList::split(',', readStringEntry(cfg, "titlebarButtonColors")));
#endif
if(cols.count() && 0==(cols.count()%NUM_TITLEBAR_BUTTONS) && cols.count()<=(NUM_TITLEBAR_BUTTONS*3))
{
- QStringList::ConstIterator it(cols.begin()),
+ TQStringList::ConstIterator it(cols.begin()),
end(cols.end());
for(int i=0; it!=end; ++it, ++i)
{
- QColor col;
+ TQColor col;
setRgb(&col, TO_LATIN1((*it)));
opts->titlebarButtonColors[i]=col;
}
@@ -2080,14 +2080,14 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
for(i=APPEARANCE_CUSTOM1; i<(APPEARANCE_CUSTOM1+NUM_CUSTOM_GRAD); ++i)
{
- QString gradKey;
+ TQString gradKey;
gradKey.sprintf("customgradient%d", (i-APPEARANCE_CUSTOM1)+1);
-#if (defined QT_VERSION && (QT_VERSION >= 0x040000))
- QStringList vals(readStringEntry(cfg, gradKey).split(',', QString::SkipEmptyParts));
+#if ( (0x039999 >= 0x040000))
+ TQStringList vals(readStringEntry(cfg, gradKey).split(',', TQString::SkipEmptyParts));
#else
- QStringList vals(QStringList::split(',', readStringEntry(cfg, gradKey)));
+ TQStringList vals(TQStringList::split(',', readStringEntry(cfg, gradKey)));
#endif
if(vals.size())
@@ -2095,7 +2095,7 @@ static bool readConfig(const char *file, Options *opts, Options *defOpts)
if(vals.size()>=5)
{
- QStringList::ConstIterator it(vals.begin()),
+ TQStringList::ConstIterator it(vals.begin()),
end(vals.end());
bool ok(true),
haveAlpha(false);
@@ -2348,7 +2348,7 @@ static void defaultSettings(Options *opts)
opts->menuDelay=DEFAULT_MENU_DELAY;
opts->sliderWidth=DEFAULT_SLIDER_WIDTH;
opts->selectionAppearance=APPEARANCE_HARSH_GRADIENT;
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000)) || !defined __cplusplus
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000)) || !defined __cplusplus
opts->round=ROUND_EXTRA;
opts->fadeLines=true;
opts->glowProgress=GLOW_NONE;
@@ -2359,7 +2359,7 @@ static void defaultSettings(Options *opts)
#ifdef __cplusplus
opts->dwtAppearance=APPEARANCE_CUSTOM1;
#endif
-#if !defined __cplusplus || (defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if !defined __cplusplus || (defined CONFIG_DIALOG && (0x039999 >= 0x040000))
opts->reorderGtkButtons=false;
#endif
opts->bgndImage.type=IMG_NONE;
@@ -2404,7 +2404,7 @@ static void defaultSettings(Options *opts)
opts->toolbarBorders=TB_NONE;
opts->toolbarSeparators=LINE_SUNKEN;
opts->splitters=LINE_1DOT;
-#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
+#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
opts->fixParentlessDialogs=false;
#ifdef __cplusplus
opts->noDlgFixApps << "kate" << "plasma" << "plasma-desktop" << "plasma-netbook";
@@ -2459,7 +2459,7 @@ static void defaultSettings(Options *opts)
opts->boldProgress=true;
opts->coloredTbarMo=false;
opts->borderSelection=false;
- opts->square=SQUARE_POPUP_MENUS;
+ opts->square=STQUARE_POPUP_MENUS;
opts->stripedSbar=false;
opts->windowDrag=WM_DRAG_NONE;
opts->shadePopupMenu=false;
@@ -2467,7 +2467,7 @@ static void defaultSettings(Options *opts)
opts->groupBox=FRAME_FADED;
opts->gbFactor=DEF_GB_FACTOR;
opts->gbLabel=GB_LBL_BOLD|GB_LBL_OUTSIDE;
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
opts->stdBtnSizes=false;
opts->titlebarButtons=TITLEBAR_BUTTON_ROUND|TITLEBAR_BUTTON_HOVER_SYMBOL;
opts->titlebarIcon=TITLEBAR_ICON_NEXT_TO_TITLE;
@@ -2494,12 +2494,12 @@ static void defaultSettings(Options *opts)
opts->titlebarAlignment=ALIGN_FULL_CENTER;
opts->titlebarEffect=EFFECT_SHADOW;
opts->centerTabText=false;
-#if defined QT_VERSION && (QT_VERSION >= 0x040000)
+#if (0x039999 >= 0x040000)
opts->xbar=false;
opts->dwtSettings=DWT_BUTTONS_AS_PER_TITLEBAR|DWT_ROUND_TOP_ONLY;
opts->menubarApps << "amarok" << "arora" << "kaffeine" << "kcalc" << "smplayer" << "VirtualBox";
opts->statusbarApps << "kde";
- opts->useQtFileDialogApps << "googleearth-bin";
+ opts->useTQtFileDialogApps << "googleearth-bin";
opts->noMenuBgndOpacityApps << "inkscape" << "inkscape" << "sonata" << "totem";
opts->noBgndOpacityApps << "smplayer" << "kaffeine" << "dragon" << "kscreenlocker" << "inkscape" << "inkscape" << "sonata" << "totem";
#endif
@@ -2543,7 +2543,7 @@ static void defaultSettings(Options *opts)
readConfig(systemFilename, opts, opts);
}
-#if !defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION < 0x040000)
+#if !defined CONFIG_DIALOG && (0x039999 < 0x040000)
if(FOCUS_FILLED==opts->focus)
opts->focus=FOCUS_FULL;
#endif
@@ -2628,7 +2628,7 @@ static const char *toStr(EMouseOver mo)
}
}
-static QString toStr(EAppearance exp, EAppAllow allow)
+static TQString toStr(EAppearance exp, EAppAllow allow)
{
switch(exp)
{
@@ -2669,7 +2669,7 @@ static QString toStr(EAppearance exp, EAppAllow allow)
}
default:
{
- QString app;
+ TQString app;
app.sprintf("customgradient%d", (exp-APPEARANCE_CUSTOM1)+1);
return app;
@@ -2677,15 +2677,15 @@ static QString toStr(EAppearance exp, EAppAllow allow)
}
}
-static QString toStr(const QColor &col)
+static TQString toStr(const TQColor &col)
{
- QString colorStr;
+ TQString colorStr;
colorStr.sprintf("#%02X%02X%02X", col.red(), col.green(), col.blue());
return colorStr;
}
-static QString toStr(EShade exp, const QColor &col)
+static TQString toStr(EShade exp, const TQColor &col)
{
switch(exp)
{
@@ -2960,7 +2960,7 @@ static const char * toStr(EImageType lv)
return "plainrings";
case IMG_BORDERED_RINGS:
return "rings";
- case IMG_SQUARE_RINGS:
+ case IMG_STQUARE_RINGS:
return "squarerings";
case IMG_FILE:
return "file";
@@ -2983,8 +2983,8 @@ static const char * toStr(EGlow lv)
}
}
-#if QT_VERSION >= 0x040000
-#include <QTextStream>
+#if 0x039999 >= 0x040000
+#include <TQTextStream>
#define CFG config
#else
#define CFG (*cfg)
@@ -3042,7 +3042,7 @@ static const char * toStr(EGlow lv)
if (!exportingStyle && def.ENTRY==opts.ENTRY) \
CFG.deleteEntry(#ENTRY); \
else \
- CFG.writeEntry(#ENTRY, QStringList(opts.ENTRY.toList()).join(",")); \
+ CFG.writeEntry(#ENTRY, TQStringList(opts.ENTRY.toList()).join(",")); \
bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, bool exportingStyle=false)
{
@@ -3052,10 +3052,10 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
if(cfgDir)
{
-#if QT_VERSION >= 0x040000
- KConfig defCfg(QFile::decodeName(cfgDir)+CONFIG_FILE, KConfig::SimpleConfig);
+#if 0x039999 >= 0x040000
+ KConfig defCfg(TQFile::decodeName(cfgDir)+CONFIG_FILE, KConfig::SimpleConfig);
#else
- KConfig defCfg(QFile::decodeName(cfgDir)+CONFIG_FILE, false, false);
+ KConfig defCfg(TQFile::decodeName(cfgDir)+CONFIG_FILE, false, false);
#endif
if(writeConfig(&defCfg, opts, def, exportingStyle))
@@ -3064,17 +3064,17 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
for(int i=0; oldFiles[i]; ++i)
{
- QString oldFileName(QFile::decodeName(cfgDir)+QString("../")+oldFiles[i]);
+ TQString oldFileName(TQFile::decodeName(cfgDir)+TQString("../")+oldFiles[i]);
- if(QFile::exists(oldFileName))
- QFile::remove(oldFileName);
+ if(TQFile::exists(oldFileName))
+ TQFile::remove(oldFileName);
}
}
}
}
else
{
-#if QT_VERSION >= 0x040000
+#if 0x039999 >= 0x040000
KConfigGroup config(cfg, SETTINGS_GROUP);
#else
cfg->setGroup(SETTINGS_GROUP);
@@ -3092,9 +3092,9 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_ENTRY(bgndGrad)
CFG_WRITE_ENTRY(menuBgndGrad)
CFG_WRITE_APPEARANCE_ENTRY(menuBgndAppearance, APP_ALLOW_STRIPED)
-#ifdef QTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
+#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
CFG_WRITE_ENTRY(fixParentlessDialogs)
-#if defined QT_VERSION && (QT_VERSION >= 0x040000)
+#if (0x039999 >= 0x040000)
CFG_WRITE_STRING_LIST_ENTRY(noDlgFixApps)
#endif
#endif
@@ -3202,14 +3202,14 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_ENTRY_NUM(windowDrag)
CFG_WRITE_ENTRY(shadePopupMenu)
CFG_WRITE_ENTRY_NUM(windowBorder)
-#if defined QT_VERSION && (QT_VERSION >= 0x040000)
+#if (0x039999 >= 0x040000)
CFG_WRITE_ENTRY(xbar)
CFG_WRITE_ENTRY_NUM(dwtSettings)
#endif
CFG_WRITE_ENTRY_NUM(bgndOpacity)
CFG_WRITE_ENTRY_NUM(menuBgndOpacity)
CFG_WRITE_ENTRY_NUM(dlgOpacity)
-#if defined CONFIG_DIALOG || (defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if defined CONFIG_DIALOG || ( (0x039999 >= 0x040000))
CFG_WRITE_ENTRY(stdBtnSizes)
CFG_WRITE_ENTRY_NUM(titlebarButtons)
CFG_WRITE_ENTRY(titlebarIcon)
@@ -3217,15 +3217,15 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
if((opts.titlebarButtons&TITLEBAR_BUTTON_COLOR || opts.titlebarButtons&TITLEBAR_BUTTON_ICON_COLOR) &&
opts.titlebarButtonColors.size() && 0==(opts.titlebarButtonColors.size()%NUM_TITLEBAR_BUTTONS))
{
- QString val;
-#if QT_VERSION >= 0x040000
- QTextStream str(&val);
+ TQString val;
+#if 0x039999 >= 0x040000
+ TQTextStream str(&val);
#else
- QTextStream str(&val, IO_WriteOnly);
+ TQTextStream str(&val, IO_WriteOnly);
#endif
for(unsigned int i=0; i<opts.titlebarButtonColors.size(); ++i)
{
- TBCols::const_iterator c(opts.titlebarButtonColors.find((ETitleBarButtons)i));
+ TBCols::const_iterator c(opts.titlebarButtonColors.tqfind((ETitleBarButtons)i));
if(c!=opts.titlebarButtonColors.end())
{
@@ -3250,14 +3250,14 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_ENTRY(gtkComboMenus)
CFG_WRITE_ENTRY(doubleGtkComboArrow)
CFG_WRITE_ENTRY(gtkButtonOrder)
-#if !defined __cplusplus || (defined CONFIG_DIALOG && defined QT_VERSION && (QT_VERSION >= 0x040000))
+#if !defined __cplusplus || (defined CONFIG_DIALOG && (0x039999 >= 0x040000))
CFG_WRITE_ENTRY(reorderGtkButtons)
#endif
CFG_WRITE_ENTRY(mapKdeIcons)
CFG_WRITE_ENTRY(shading)
CFG_WRITE_ENTRY(titlebarAlignment)
CFG_WRITE_ENTRY(centerTabText)
-#if defined QT_VERSION && (QT_VERSION >= 0x040000)
+#if (0x039999 >= 0x040000)
CFG_WRITE_STRING_LIST_ENTRY(noBgndGradientApps)
CFG_WRITE_STRING_LIST_ENTRY(noBgndOpacityApps)
CFG_WRITE_STRING_LIST_ENTRY(noMenuBgndOpacityApps)
@@ -3265,13 +3265,13 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
CFG_WRITE_STRING_LIST_ENTRY(noMenuStripeApps)
CFG_WRITE_STRING_LIST_ENTRY(menubarApps)
CFG_WRITE_STRING_LIST_ENTRY(statusbarApps)
- CFG_WRITE_STRING_LIST_ENTRY(useQtFileDialogApps)
+ CFG_WRITE_STRING_LIST_ENTRY(useTQtFileDialogApps)
#endif
for(int i=APPEARANCE_CUSTOM1; i<(APPEARANCE_CUSTOM1+NUM_CUSTOM_GRAD); ++i)
{
- GradientCont::const_iterator cg(opts.customGradient.find((EAppearance)i));
- QString gradKey;
+ GradientCont::const_iterator cg(opts.customGradient.tqfind((EAppearance)i));
+ TQString gradKey;
gradKey.sprintf("customgradient%d", (i-APPEARANCE_CUSTOM1)+1);
@@ -3281,13 +3281,13 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
{
GradientCont::const_iterator d;
- if(exportingStyle || (d=def.customGradient.find((EAppearance)i))==def.customGradient.end() || !((*d)==(*cg)))
+ if(exportingStyle || (d=def.customGradient.tqfind((EAppearance)i))==def.customGradient.end() || !((*d)==(*cg)))
{
- QString gradVal;
-#if QT_VERSION >= 0x040000
- QTextStream str(&gradVal);
+ TQString gradVal;
+#if 0x039999 >= 0x040000
+ TQTextStream str(&gradVal);
#else
- QTextStream str(&gradVal, IO_WriteOnly);
+ TQTextStream str(&gradVal, IO_WriteOnly);
#endif
GradientStopCont stops((*cg).second.stops.fix());
GradientStopCont::const_iterator it(stops.begin()),
@@ -3323,11 +3323,11 @@ bool static writeConfig(KConfig *cfg, const Options &opts, const Options &def, b
opts.customShades[4]!=def.customShades[4] ||
opts.customShades[5]!=def.customShades[5])
{
- QString shadeVal;
-#if QT_VERSION >= 0x040000
- QTextStream str(&shadeVal);
+ TQString shadeVal;
+#if 0x039999 >= 0x040000
+ TQTextStream str(&shadeVal);
#else
- QTextStream str(&shadeVal, IO_WriteOnly);
+ TQTextStream str(&shadeVal, IO_WriteOnly);
#endif
if(0==opts.customShades[0])
str << 0;