summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2015-07-12 17:04:57 (GMT)
committer Slávek Banko <slavek.banko@axis.cz>2015-07-12 17:04:57 (GMT)
commit8f8831f315b8f75565455416c168fc80bfac9b9e (patch)
treec50cb1e081f06f2b11480ef645c4829aa7859c2c
parent9a4419b617a931aa96ce6aa5b7f13a0af209dd31 (diff)
downloadksquirrel-8f8831f3.zip
ksquirrel-8f8831f3.tar.gz
Use preprocessor stringify for libksquirrel definitions
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--ksquirrel/ksquirrel-libs-configurator/klc.ui.h9
-rw-r--r--ksquirrel/ksquirrelpart/sq_libraryhandler.cpp7
-rw-r--r--ksquirrel/sq_libraryhandler.cpp7
-rw-r--r--ksquirrel/sq_pluginsinfo.ui.h7
4 files changed, 25 insertions, 5 deletions
diff --git a/ksquirrel/ksquirrel-libs-configurator/klc.ui.h b/ksquirrel/ksquirrel-libs-configurator/klc.ui.h
index cc6f9b1..ccccad2 100644
--- a/ksquirrel/ksquirrel-libs-configurator/klc.ui.h
+++ b/ksquirrel/ksquirrel-libs-configurator/klc.ui.h
@@ -10,6 +10,11 @@
** destructor.
*****************************************************************************/
+#if !defined(QT_STRINGIFY)
+# define QT_STRINGIFY2(x) #x
+# define QT_STRINGIFY(x) QT_STRINGIFY2(x)
+#endif
+
void KLC::init()
{
changed = false;
@@ -25,7 +30,7 @@ void KLC::init()
connect(lister, TQT_SIGNAL(deleteItem(KFileItem *)), this, TQT_SLOT(slotDeleteItem(KFileItem *)));
connect(lister, TQT_SIGNAL(newItems(const KFileItemList &)), this, TQT_SLOT(slotNewItems(const KFileItemList &)));
- base = KURL::fromPathOrURL(SQ_KLIBS);
+ base = KURL::fromPathOrURL(QT_STRINGIFY(SQ_KLIBS));
backup = base;
backup.addPath("backup");
@@ -99,7 +104,7 @@ void KLC::slotNewItems(const KFileItemList &list)
{
KFileItemListIterator it(list);
KFileItem *fi;
- TQString soname = TQString::fromLatin1(".so.%1").arg(SQ_KL_VER);
+ TQString soname = TQString::fromLatin1(".so.%1").arg(QT_STRINGIFY(SQ_KL_VER));
while((fi = it.current()))
{
diff --git a/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp b/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp
index 51d5e9b..3b6cf2c 100644
--- a/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp
+++ b/ksquirrel/ksquirrelpart/sq_libraryhandler.cpp
@@ -41,6 +41,11 @@
#include <iostream>
#include <iomanip>
+#if !defined(QT_STRINGIFY)
+# define QT_STRINGIFY2(x) #x
+# define QT_STRINGIFY(x) QT_STRINGIFY2(x)
+#endif
+
static const int buffer_size = 10;
SQ_LibraryHandler * SQ_LibraryHandler::m_instance = 0;
@@ -513,7 +518,7 @@ void SQ_LibraryHandler::load()
{
TQStringList libs;
- TQDir dir(SQ_KLIBS, TQString(), TQDir::Unsorted, TQDir::Files);
+ TQDir dir(QT_STRINGIFY(SQ_KLIBS), TQString(), TQDir::Unsorted, TQDir::Files);
const TQFileInfoList *list = dir.entryInfoList();
diff --git a/ksquirrel/sq_libraryhandler.cpp b/ksquirrel/sq_libraryhandler.cpp
index 51d5e9b..3b6cf2c 100644
--- a/ksquirrel/sq_libraryhandler.cpp
+++ b/ksquirrel/sq_libraryhandler.cpp
@@ -41,6 +41,11 @@
#include <iostream>
#include <iomanip>
+#if !defined(QT_STRINGIFY)
+# define QT_STRINGIFY2(x) #x
+# define QT_STRINGIFY(x) QT_STRINGIFY2(x)
+#endif
+
static const int buffer_size = 10;
SQ_LibraryHandler * SQ_LibraryHandler::m_instance = 0;
@@ -513,7 +518,7 @@ void SQ_LibraryHandler::load()
{
TQStringList libs;
- TQDir dir(SQ_KLIBS, TQString(), TQDir::Unsorted, TQDir::Files);
+ TQDir dir(QT_STRINGIFY(SQ_KLIBS), TQString(), TQDir::Unsorted, TQDir::Files);
const TQFileInfoList *list = dir.entryInfoList();
diff --git a/ksquirrel/sq_pluginsinfo.ui.h b/ksquirrel/sq_pluginsinfo.ui.h
index f8e7d55..6522b62 100644
--- a/ksquirrel/sq_pluginsinfo.ui.h
+++ b/ksquirrel/sq_pluginsinfo.ui.h
@@ -7,6 +7,11 @@
** place of a destructor.
*****************************************************************************/
+#if !defined(QT_STRINGIFY)
+# define QT_STRINGIFY2(x) #x
+# define QT_STRINGIFY(x) QT_STRINGIFY2(x)
+#endif
+
/*
* SQ_PluginsInfo shows all found by SQ_LibraryListener libraries.
*/
@@ -23,7 +28,7 @@ void SQ_PluginsInfo::showLibs()
{
int cnt = SQ_LibraryHandler::instance()->count();
- textLibs->setText(SQ_KLIBS);
+ textLibs->setText(QT_STRINGIFY(SQ_KLIBS));
textCount->setNum(cnt);
if(!cnt) return;