summaryrefslogtreecommitdiffstats
path: root/kbfxlib/data
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-05 22:07:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-05 22:07:15 +0000
commit421b60af92c83b889f8903c2898f2bd07186fcd8 (patch)
treead873a24c9438baed4942fda795430a4c3dc9a9a /kbfxlib/data
parent39e896bddf25bf34cbf8be814d959181e2c1d1dd (diff)
downloadkbfx-421b60af92c83b889f8903c2898f2bd07186fcd8.tar.gz
kbfx-421b60af92c83b889f8903c2898f2bd07186fcd8.zip
TQt4 port kbfx
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbfx@1230544 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbfxlib/data')
-rw-r--r--kbfxlib/data/kbfxdatagroup.cpp4
-rw-r--r--kbfxlib/data/kbfxdatagroup.h20
-rw-r--r--kbfxlib/data/kbfxdatagrouplist.h16
-rw-r--r--kbfxlib/data/kbfxdatasource.cpp12
-rw-r--r--kbfxlib/data/kbfxdatasource.h50
-rw-r--r--kbfxlib/data/kbfxdatastack.cpp10
-rw-r--r--kbfxlib/data/kbfxdatastack.h30
-rw-r--r--kbfxlib/data/kbfxplasmapluginloader.cpp36
-rw-r--r--kbfxlib/data/kbfxplasmapluginloader.h19
-rw-r--r--kbfxlib/data/kbfxplugin.cpp14
-rw-r--r--kbfxlib/data/kbfxplugin.h25
11 files changed, 119 insertions, 117 deletions
diff --git a/kbfxlib/data/kbfxdatagroup.cpp b/kbfxlib/data/kbfxdatagroup.cpp
index 5c097a6..1866387 100644
--- a/kbfxlib/data/kbfxdatagroup.cpp
+++ b/kbfxlib/data/kbfxdatagroup.cpp
@@ -40,7 +40,7 @@ KbfxDataGroup::~KbfxDataGroup()
}
KbfxDataSource::DataSourceList
-KbfxDataGroup::lookup ( QString str )
+KbfxDataGroup::lookup ( TQString str )
{
//static KbfxDataGroup * _matching = new KbfxDataGroup();
KbfxDataSource::DataSourceList _matching;
@@ -79,7 +79,7 @@ KbfxDataGroup::itemAt(int index)
KbfxDataSource *
-KbfxDataGroup::getItem ( QString name )
+KbfxDataGroup::getItem ( TQString name )
{
return m_data[name];
}
diff --git a/kbfxlib/data/kbfxdatagroup.h b/kbfxlib/data/kbfxdatagroup.h
index 7587502..1e3eeef 100644
--- a/kbfxlib/data/kbfxdatagroup.h
+++ b/kbfxlib/data/kbfxdatagroup.h
@@ -22,16 +22,16 @@
#ifndef KBFX_DATA_GROUP_H
#define KBFX_DATA_GROUP_H
-#include <qmap.h>
-#include <qstringlist.h>
+#include <tqmap.h>
+#include <tqstringlist.h>
#include "kbfxdatasource.h"
class KbfxDataGroup
{
public:
- typedef QMap<QString,KbfxDataSource*> Data;
- typedef QMap<int,KbfxDataSource*> Index;
+ typedef TQMap<TQString,KbfxDataSource*> Data;
+ typedef TQMap<int,KbfxDataSource*> Index;
/**
* Construts a new data group and initialzes the group
@@ -55,16 +55,16 @@ class KbfxDataGroup
* "Unknown Group" . it is recomended that a name is always set
* @param name The name that should be give to the group
*/
- void setName ( QString name ) {m_name = name;}
+ void setName ( TQString name ) {m_name = name;}
/**
* To access a datasource give the name of the datasource
* @param The name othe datasource
* @return pointer to a valid datasource
*/
- KbfxDataSource * getItem ( QString );
+ KbfxDataSource * getItem ( TQString );
/**
* use this to get all the items inside the datagroup
- * @return a copy of the data Map (QMap<QString,KbfxDataSource*>)
+ * @return a copy of the data Map (TQMap<TQString,KbfxDataSource*>)
*/
Data getData();
/**
@@ -72,12 +72,12 @@ class KbfxDataGroup
* @param keyword to search for
* @return list of matching datasources
*/
- KbfxDataSource::DataSourceList lookup ( QString );
+ KbfxDataSource::DataSourceList lookup ( TQString );
/**
* The name of the group
* @return Name of the group
*/
- QString name() {return m_name;}
+ TQString name() {return m_name;}
/**
* The number of datasources inside the datagroup
* @return number of datasources
@@ -92,7 +92,7 @@ class KbfxDataGroup
private:
Data m_data;
- QString m_name;
+ TQString m_name;
int m_count;
Index m_index;
};
diff --git a/kbfxlib/data/kbfxdatagrouplist.h b/kbfxlib/data/kbfxdatagrouplist.h
index 711b7af..c21b011 100644
--- a/kbfxlib/data/kbfxdatagrouplist.h
+++ b/kbfxlib/data/kbfxdatagrouplist.h
@@ -22,29 +22,29 @@
#ifndef KBFX_DATA_GROUP_LIST_H
#define KBFX_DATA_GROUP_LIST_H
-#include <qptrlist.h>
+#include <tqptrlist.h>
#include "kbfxdatagroup.h"
class KbfxDataGroupList
{
public:
- typedef QPtrList<KbfxDataGroup> GroupList;
+ typedef TQPtrList<KbfxDataGroup> GroupList;
KbfxDataGroupList();
~KbfxDataGroupList();
//in
void addGroup ( KbfxDataGroup * group );
- void setName ( QString name ) { m_name = name;}
- void setIcon ( QString path ) { m_iconPath = path;}
+ void setName ( TQString name ) { m_name = name;}
+ void setIcon ( TQString path ) { m_iconPath = path;}
//out
- QString name() {return m_name;}
+ TQString name() {return m_name;}
GroupList getGroup() { return m_groupList;}
- QString iconPath() { return m_iconPath;}
+ TQString iconPath() { return m_iconPath;}
int count() {return m_count;}
private:
- QString m_name;
- QString m_iconPath;
+ TQString m_name;
+ TQString m_iconPath;
GroupList m_groupList;
int m_count;
};
diff --git a/kbfxlib/data/kbfxdatasource.cpp b/kbfxlib/data/kbfxdatasource.cpp
index 8a44478..91d13c2 100644
--- a/kbfxlib/data/kbfxdatasource.cpp
+++ b/kbfxlib/data/kbfxdatasource.cpp
@@ -38,15 +38,15 @@ KbfxDataSource::~KbfxDataSource()
}
bool
-KbfxDataSource::lookup ( QString str )
+KbfxDataSource::lookup ( TQString str )
{
if ( str.isNull() )
return false;
- QString _searchStr = m_text+m_comment+m_description+m_keyWords;
+ TQString _searchStr = m_text+m_comment+m_description+m_keyWords;
- if ( _searchStr.contains ( str,false ) > 0 )
+ if ( _searchStr.tqcontains ( str,false ) > 0 )
return true;
return false;
@@ -74,11 +74,11 @@ KbfxDataSource::exec()
if ( type() == KbfxDataSource::DESKTOP )
{
- QCString dcop;
+ TQCString dcop;
int pid;
- QString m_error;
+ TQString m_error;
KApplication::startServiceByDesktopPath ( desktopFile(),
- QString::null, &m_error,&dcop,&pid,"",true );
+ TQString(), &m_error,&dcop,&pid,"",true );
}
else
diff --git a/kbfxlib/data/kbfxdatasource.h b/kbfxlib/data/kbfxdatasource.h
index aba89ad..ea121a4 100644
--- a/kbfxlib/data/kbfxdatasource.h
+++ b/kbfxlib/data/kbfxdatasource.h
@@ -22,8 +22,8 @@
#ifndef KBFX_DATA_SOURCE_H
#define KBFX_DATA_SOURCE_H
-#include <qvaluelist.h>
-#include <qstring.h>
+#include <tqvaluelist.h>
+#include <tqstring.h>
class KbfxDataSource
{
@@ -32,7 +32,7 @@ class KbfxDataSource
public:
typedef enum
{ DESKTOP = 0, NONDESKTOP } Type;
- typedef QValueList < KbfxDataSource > DataSourceList;
+ typedef TQValueList < KbfxDataSource > DataSourceList;
/**
* Constructs a new DataSource. Data source is a simple class that holds
* a .desktop file and also you can include a custom commmand that can be
@@ -47,7 +47,7 @@ class KbfxDataSource
* a desktop file use KbfxDataSource::setDesktopPath() functions instead
* @param name should be the name of the data source
*/
- void setName ( QString name )
+ void setName ( TQString name )
{
m_text = name;
}
@@ -57,24 +57,24 @@ class KbfxDataSource
* abstracts such functions.
* @param path should be the absolute path of a valid desktop file
*/
- void setDesktopPath ( QString path )
+ void setDesktopPath ( TQString path )
{
m_desktopPath = path;
m_type = DESKTOP;
loadDesktopFile ();
}
- virtual void setCommand ( QString cmd )
+ virtual void setCommand ( TQString cmd )
{
m_command = cmd;
}
- void setContentPath ( QString path )
+ void setContentPath ( TQString path )
{
m_contentPath = path;
}
- QString contentPath ()
+ TQString contentPath ()
{
return m_contentPath;
}
@@ -86,35 +86,35 @@ class KbfxDataSource
virtual void exec ();
- void setComment ( QString comment )
+ void setComment ( TQString comment )
{
m_comment = comment;
};
- void setDescription ( QString desc )
+ void setDescription ( TQString desc )
{
m_description = desc;
}
- void setIconPath ( QString path )
+ void setIconPath ( TQString path )
{
m_iconPath = path;
}
- QString desktopFile ()
+ TQString desktopFile ()
{
return m_desktopPath;
}
//out
- QString name ()
+ TQString name ()
{
return m_text;
}
- QString icon ()
+ TQString icon ()
{
return m_iconPath;
};
- QString command ()
+ TQString command ()
{
return m_command;
}
@@ -127,24 +127,24 @@ class KbfxDataSource
* functio will NOT return NULL so no checking needed
* @return the comment of the data source or empty string
*/
- QString comment ()
+ TQString comment ()
{
return m_comment;
}
- bool lookup ( QString str );
+ bool lookup ( TQString str );
private:
//TODO
//MOve to private D
void loadDesktopFile ();
- QString m_text;
- QString m_desktopPath;
- QString m_command;
- QString m_iconPath;
- QString m_comment;
- QString m_description;
- QString m_keyWords;
+ TQString m_text;
+ TQString m_desktopPath;
+ TQString m_command;
+ TQString m_iconPath;
+ TQString m_comment;
+ TQString m_description;
+ TQString m_keyWords;
Type m_type;
- QString m_contentPath;
+ TQString m_contentPath;
};
diff --git a/kbfxlib/data/kbfxdatastack.cpp b/kbfxlib/data/kbfxdatastack.cpp
index 2d84e02..2b28ba0 100644
--- a/kbfxlib/data/kbfxdatastack.cpp
+++ b/kbfxlib/data/kbfxdatastack.cpp
@@ -48,18 +48,18 @@ KbfxDataStack::addGroupList ( KbfxDataGroupList * list )
m_count++;
}
-QStringList
+TQStringList
KbfxDataStack::getStackIndex()
{
return m_nameList;
}
KbfxDataGroupList *
-KbfxDataStack::getStack ( QString name )
+KbfxDataStack::getStack ( TQString name )
{
- if ( m_nameList.contains ( name ) >0 )
+ if ( m_nameList.tqcontains ( name ) >0 )
return m_stack[name];
else
{
@@ -68,7 +68,7 @@ KbfxDataStack::getStack ( QString name )
}
-QString
+TQString
KbfxDataStack::getSubGroupName ( uint id )
{
@@ -79,6 +79,6 @@ KbfxDataStack::getSubGroupName ( uint id )
return it.key();
}
- return QString ( "Empty" );
+ return TQString ( "Empty" );
}
diff --git a/kbfxlib/data/kbfxdatastack.h b/kbfxlib/data/kbfxdatastack.h
index 6d65810..c91f524 100644
--- a/kbfxlib/data/kbfxdatastack.h
+++ b/kbfxlib/data/kbfxdatastack.h
@@ -22,9 +22,9 @@
#ifndef KBFX_DATA_STACK_H
#define KBFX_DATA_STACK_H
-#include <qmap.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqmap.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
#include "kbfxdatagrouplist.h"
#include "kbfxplasmacanvasstackdata.h" //TODO:change the name here
@@ -32,29 +32,29 @@ class KbfxDataStack
{
public:
- typedef QMap<QString,KbfxDataGroupList*> StackMap;
- typedef QMap<QString,uint> Dict;
- typedef QMap<int,KbfxPlasmaCanvasStackData> DataDict;
+ typedef TQMap<TQString,KbfxDataGroupList*> StackMap;
+ typedef TQMap<TQString,uint> Dict;
+ typedef TQMap<int,KbfxPlasmaCanvasStackData> DataDict;
KbfxDataStack();
~KbfxDataStack();
- void setName ( QString name ) { m_name=name;}
+ void setName ( TQString name ) { m_name=name;}
void addGroupList ( KbfxDataGroupList * list );
//out
- KbfxDataGroupList * getGroupList ( QString name );
- QStringList getStackIndex();
- KbfxDataGroupList * getStack ( QString name );
+ KbfxDataGroupList * getGroupList ( TQString name );
+ TQStringList getStackIndex();
+ KbfxDataGroupList * getStack ( TQString name );
Dict getDict() {return m_dict;}
DataDict getDataDict() { return m_dataDict;}
- QString name() {return m_name;}
- uint getIndex ( QString name ) { return m_dict[name];}
- QString getSubGroupName ( uint id );
+ TQString name() {return m_name;}
+ uint getIndex ( TQString name ) { return m_dict[name];}
+ TQString getSubGroupName ( uint id );
int count() {return m_count;}
private:
StackMap m_stack;
- QStringList m_nameList;
- QString m_name;
+ TQStringList m_nameList;
+ TQString m_name;
Dict m_dict;
DataDict m_dataDict;
uint m_count;
diff --git a/kbfxlib/data/kbfxplasmapluginloader.cpp b/kbfxlib/data/kbfxplasmapluginloader.cpp
index ebc992a..ed2c458 100644
--- a/kbfxlib/data/kbfxplasmapluginloader.cpp
+++ b/kbfxlib/data/kbfxplasmapluginloader.cpp
@@ -22,8 +22,8 @@
#include <config.h>
#include "kbfxplasmapluginloader.h"
-#include <qdir.h>
-#include <qfileinfo.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
#include <kstandarddirs.h>
#include <kdebug.h>
@@ -39,31 +39,31 @@ void
KbfxPlasmaPluginLoader::init()
{
- QString libprefix = locate ( "lib","libkbfxdata.so" );
+ TQString libprefix = locate ( "lib","libkbfxdata.so" );
libprefix.remove ( "libkbfxdata.so" );
-// QString libprefix = KBFX_LIB_INSTALL_DIR ;
+// TQString libprefix = KBFX_LIB_INSTALL_DIR ;
kdDebug() << "KBFX plugins lib is: " << libprefix << endl;
- QDir * _dir = new QDir ( libprefix+"/kbfx/plugins/" );
- QStringList plugins;
- _dir->setFilter ( QDir::Files );
+ TQDir * _dir = new TQDir ( libprefix+"/kbfx/plugins/" );
+ TQStringList plugins;
+ _dir->setFilter ( TQDir::Files );
_dir->setNameFilter ( "*.so" );
if ( !_dir->exists() )
{
kdDebug() << "Invalid Plugin Prefix: " << libprefix << "/kbfx/plugins/" << endl;
delete _dir;
- return ;//QStringList("No Plugins found: Error in default Paths.Contact Package Manager");
+ return ;//TQStringList("No Plugins found: Error in default Paths.Contact Package Manager");
}
- const QFileInfoList *list = _dir->entryInfoList();
- QFileInfoListIterator it ( *list );
- QFileInfo *fi=0;
+ const TQFileInfoList *list = _dir->entryInfoList();
+ TQFileInfoListIterator it ( *list );
+ TQFileInfo *fi=0;
int _index =0;
while ( ( fi = it.current() ) != 0 )
{
- QString * path = new QString ( libprefix+"/kbfx/plugins/"+fi->fileName() );
- QLibrary * _l = new QLibrary ( *path );
+ TQString * path = new TQString ( libprefix+"/kbfx/plugins/"+fi->fileName() );
+ TQLibrary * _l = new TQLibrary ( *path );
- typedef QString ( *getName ) ();
+ typedef TQString ( *getName ) ();
getName nameFunc;
nameFunc = ( getName ) _l->resolve ( "name" );
if ( nameFunc )
@@ -95,7 +95,7 @@ KbfxPlasmaPluginLoader::~KbfxPlasmaPluginLoader()
}
KbfxDataStack *
-KbfxPlasmaPluginLoader::getView ( QString name )
+KbfxPlasmaPluginLoader::getView ( TQString name )
{
PluginMap::Iterator it;
for ( it = pluginMap().begin(); it != pluginMap().end(); ++it )
@@ -113,7 +113,7 @@ KbfxPlasmaPluginLoader::getView ( QString name )
}
KbfxDataGroup *
-KbfxPlasmaPluginLoader::search ( QString pname,QString keyword )
+KbfxPlasmaPluginLoader::search ( TQString pname,TQString keyword )
{
if ( pname == NULL )
return NULL;
@@ -142,12 +142,12 @@ KbfxPlasmaPluginLoader::pluginMap()
-QStringList
+TQStringList
KbfxPlasmaPluginLoader::scanPlugins()
{
init();
- QStringList plugins;
+ TQStringList plugins;
PluginMap::Iterator it;
for ( it = pluginMap().begin(); it != pluginMap().end();++it )
diff --git a/kbfxlib/data/kbfxplasmapluginloader.h b/kbfxlib/data/kbfxplasmapluginloader.h
index 2ae2f54..346be7f 100644
--- a/kbfxlib/data/kbfxplasmapluginloader.h
+++ b/kbfxlib/data/kbfxplasmapluginloader.h
@@ -22,18 +22,19 @@
#ifndef KBFX_PLASMA_PLUGIN_LOADER_H
#define KBFX_PLASMA_PLUGIN_LOADER_H
-#include <qlibrary.h>
+#include <tqlibrary.h>
#include "kbfxplasmacanvasstack.h"
#include "kbfxdatastack.h"
#include "kbfxplugin.h"
-#include <qcanvas.h>
+#include <tqcanvas.h>
-class KbfxPlasmaPluginLoader:public QObject
+class KbfxPlasmaPluginLoader:public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- typedef QMap<QString,KbfxPlugin*> PluginMap;
+ typedef TQMap<TQString,KbfxPlugin*> PluginMap;
/**
*
@@ -50,11 +51,11 @@ class KbfxPlasmaPluginLoader:public QObject
* @param name
* @return
*/
- KbfxDataStack * getView ( QString name );
+ KbfxDataStack * getView ( TQString name );
/*
look for all installed Plugins. returns a list of installed plugins
*/
- static QStringList scanPlugins();
+ static TQStringList scanPlugins();
/**
* Calls the search function of a given plugin and returns the result
@@ -62,16 +63,16 @@ class KbfxPlasmaPluginLoader:public QObject
* @param keyword the keyword to pass to the plugin
* @return a valid KbfxDataGroup or -1
*/
- static KbfxDataGroup * search ( QString pluginName,QString keyword );
+ static KbfxDataGroup * search ( TQString pluginName,TQString keyword );
protected:
static void init();
private:
- QLibrary * m_plugin;
+ TQLibrary * m_plugin;
static PluginMap& pluginMap();
- QString m_prefix;
+ TQString m_prefix;
};
diff --git a/kbfxlib/data/kbfxplugin.cpp b/kbfxlib/data/kbfxplugin.cpp
index ae53d67..198bde4 100644
--- a/kbfxlib/data/kbfxplugin.cpp
+++ b/kbfxlib/data/kbfxplugin.cpp
@@ -21,7 +21,7 @@
#include "kbfxplugin.h"
-KbfxPlugin::KbfxPlugin ( QString name,QString lib,uint id )
+KbfxPlugin::KbfxPlugin ( TQString name,TQString lib,uint id )
{
m_name = name;
m_libName = lib;
@@ -39,13 +39,13 @@ KbfxPlugin::~KbfxPlugin()
// delete [] m_libName;
}
-QString
+TQString
KbfxPlugin::name()
{
return m_name;
}
-QString
+TQString
KbfxPlugin::libName()
{
return m_libName;
@@ -69,7 +69,7 @@ KbfxPlugin::data()
typedef KbfxDataStack * ( *KbfxPluginView ) ();
KbfxDataStack * m_stack =0;
KbfxPluginView m_hook;
- QLibrary * m_plugin = new QLibrary ( m_libName );
+ TQLibrary * m_plugin = new TQLibrary ( m_libName );
if ( m_plugin == NULL )
return new KbfxDataStack();
@@ -86,7 +86,7 @@ KbfxPlugin::data()
}
KbfxDataGroup *
-KbfxPlugin::search ( QString keyword )
+KbfxPlugin::search ( TQString keyword )
{
if ( keyword == 0 )
return NULL;//new KbfxDataGroup();
@@ -95,10 +95,10 @@ KbfxPlugin::search ( QString keyword )
return NULL;//KbfxDataGroup();
- typedef KbfxDataGroup * ( *KbfxPluginSearch ) ( QString key );
+ typedef KbfxDataGroup * ( *KbfxPluginSearch ) ( TQString key );
KbfxDataGroup * m_group =0;
KbfxPluginSearch m_hook;
- QLibrary * m_plugin = new QLibrary ( m_libName );
+ TQLibrary * m_plugin = new TQLibrary ( m_libName );
m_hook = ( KbfxPluginSearch ) m_plugin->resolve ( "search" );
m_group = m_hook ( keyword );
m_plugin->unload();
diff --git a/kbfxlib/data/kbfxplugin.h b/kbfxlib/data/kbfxplugin.h
index 5868d14..f657d8a 100644
--- a/kbfxlib/data/kbfxplugin.h
+++ b/kbfxlib/data/kbfxplugin.h
@@ -23,9 +23,9 @@
#define KBFX_PLUGIN_H
//#include "kbfxplasmacanvasstack.h"
#include "kbfxdatastack.h"
-#include <qobject.h>
-#include <qstring.h>
-#include <qlibrary.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqlibrary.h>
/**
This class reprecentes a plugin
written for kbfx menu this
@@ -34,25 +34,26 @@ of the menu
**/
-class KbfxPlugin:public QObject
+class KbfxPlugin:public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
KbfxPlugin();
- KbfxPlugin ( QString Name,QString lib,uint id );
+ KbfxPlugin ( TQString Name,TQString lib,uint id );
~KbfxPlugin();
- void setStatus ( bool );
+ void settqStatus ( bool );
- QString name();
- QString libName();
+ TQString name();
+ TQString libName();
uint id();
bool status();
// KbfxPlasmaCanvasStack * data();
KbfxDataStack * data();
- KbfxDataGroup * search ( QString keyword );
+ KbfxDataGroup * search ( TQString keyword );
// KbfxDataStack * data();
@@ -62,12 +63,12 @@ class KbfxPlugin:public QObject
void loadComplete();
private:
- QString m_name;
- QString m_libName;
+ TQString m_name;
+ TQString m_libName;
uint m_id;
// KbfxPlasmaCanvasStack * m_data;
KbfxDataStack m_data_R;
-// QCanvas * m_canvas;
+// TQCanvas * m_canvas;
bool m_loaded;
};