summaryrefslogtreecommitdiffstats
path: root/kivio/kiviopart/kiviostencilsetaction.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kivio/kiviopart/kiviostencilsetaction.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kivio/kiviopart/kiviostencilsetaction.cpp')
-rw-r--r--kivio/kiviopart/kiviostencilsetaction.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/kivio/kiviopart/kiviostencilsetaction.cpp b/kivio/kiviopart/kiviostencilsetaction.cpp
index 16cfcd86..b12d157f 100644
--- a/kivio/kiviopart/kiviostencilsetaction.cpp
+++ b/kivio/kiviopart/kiviostencilsetaction.cpp
@@ -29,13 +29,13 @@
#include <kiconloader.h>
#include <klocale.h>
-#include <qfile.h>
-#include <qdir.h>
-#include <qpixmap.h>
-#include <qwhatsthis.h>
-#include <qmenubar.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqpixmap.h>
+#include <tqwhatsthis.h>
+#include <tqmenubar.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
#include "kivio_stencil_spawner_set.h"
@@ -63,9 +63,9 @@ static const char * default_plug_xpm[] = {
" ..............#",
" ##############"};
-KivioStencilSetAction::KivioStencilSetAction(const QString &text, const QString &pix,
- KActionCollection *parent, const char *name)
- : KAction(text, pix, 0, parent, name)
+KivioStencilSetAction::KivioStencilSetAction(const TQString &text, const TQString &pix,
+ KActionCollection *tqparent, const char *name)
+ : KAction(text, pix, 0, tqparent, name)
{
setShortcutConfigurable( false );
@@ -87,20 +87,20 @@ KPopupMenu* KivioStencilSetAction::popupMenu() const
return m_popup;
}
-void KivioStencilSetAction::popup( const QPoint& global )
+void KivioStencilSetAction::popup( const TQPoint& global )
{
popupMenu()->popup(global);
}
-int KivioStencilSetAction::plug( QWidget* widget, int index)
+int KivioStencilSetAction::plug( TQWidget* widget, int index)
{
// This function is copied from KActionMenu::plug
if (kapp && !kapp->authorizeKAction(name()))
return -1;
kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis
- if ( widget->inherits("QPopupMenu") )
+ if ( widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) )
{
- QPopupMenu* menu = static_cast<QPopupMenu*>( widget );
+ TQPopupMenu* menu = static_cast<TQPopupMenu*>( widget );
int id;
if ( hasIconSet() )
@@ -113,7 +113,7 @@ int KivioStencilSetAction::plug( QWidget* widget, int index)
menu->setItemEnabled( id, false );
addContainer( menu, id );
- connect( menu, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
+ connect( menu, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) );
return containerCount() - 1;
}
@@ -124,8 +124,8 @@ int KivioStencilSetAction::plug( QWidget* widget, int index)
int id_ = KAction::getToolButtonID();
if ( icon().isEmpty() && !iconSet().isNull() )
- bar->insertButton( iconSet().pixmap(), id_, SIGNAL( clicked() ), this,
- SLOT( slotActivated() ), isEnabled(), plainText(),
+ bar->insertButton( iconSet().pixmap(), id_, TQT_SIGNAL( clicked() ), this,
+ TQT_SLOT( slotActivated() ), isEnabled(), plainText(),
index );
else
{
@@ -136,25 +136,25 @@ int KivioStencilSetAction::plug( QWidget* widget, int index)
else
instance = KGlobal::instance();
- bar->insertButton( icon(), id_, SIGNAL( clicked() ), this,
- SLOT( slotActivated() ), isEnabled(), plainText(),
+ bar->insertButton( icon(), id_, TQT_SIGNAL( clicked() ), this,
+ TQT_SLOT( slotActivated() ), isEnabled(), plainText(),
index, instance );
}
addContainer( bar, id_ );
if (!whatsThis().isEmpty())
- QWhatsThis::add( bar->getButton(id_), whatsThis() );
+ TQWhatsThis::add( bar->getButton(id_), whatsThis() );
- connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
+ connect( bar, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) );
bar->getButton(id_)->setPopup(popupMenu(), true );
return containerCount() - 1;
}
- else if ( widget->inherits( "QMenuBar" ) )
+ else if ( widget->inherits( TQMENUBAR_OBJECT_NAME_STRING ) )
{
- QMenuBar *bar = static_cast<QMenuBar *>( widget );
+ TQMenuBar *bar = static_cast<TQMenuBar *>( widget );
int id;
@@ -164,7 +164,7 @@ int KivioStencilSetAction::plug( QWidget* widget, int index)
bar->setItemEnabled( id, false );
addContainer( bar, id );
- connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
+ connect( bar, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) );
return containerCount() - 1;
}
@@ -177,7 +177,7 @@ void KivioStencilSetAction::updateMenu()
m_ssId = 0;
m_popup->clear();
- m_popup->insertItem(i18n("Show Stencil Set Chooser"), this, SIGNAL(showDialog()));
+ m_popup->insertItem(i18n("Show Stencil Set Chooser"), this, TQT_SIGNAL(showDialog()));
m_popup->insertSeparator();
m_pathList.clear();
@@ -185,27 +185,27 @@ void KivioStencilSetAction::updateMenu()
clearCollectionMenuList();
KStandardDirs *dirs = KGlobal::dirs();
- QStringList dirList = dirs->findDirs("data", "kivio/stencils");
+ TQStringList dirList = dirs->findDirs("data", "kivio/stencils");
dirList.sort();
- for( QStringList::Iterator it = dirList.begin(); it != dirList.end(); ++it )
+ for( TQStringList::Iterator it = dirList.begin(); it != dirList.end(); ++it )
{
- QString dir = (*it);
+ TQString dir = (*it);
loadCollections(dir);
}
}
-void KivioStencilSetAction::loadCollections( const QString& rootDirStr )
+void KivioStencilSetAction::loadCollections( const TQString& rootDirStr )
{
- QDir rootDir( rootDirStr );
+ TQDir rootDir( rootDirStr );
- rootDir.setFilter( QDir::Dirs );
- rootDir.setSorting( QDir::Name );
+ rootDir.setFilter( TQDir::Dirs );
+ rootDir.setSorting( TQDir::Name );
- const QFileInfoList *colList = rootDir.entryInfoList();
- QFileInfoListIterator colIt( *colList );
- QFileInfo *colFInfo;
- QString cId;
+ const TQFileInfoList *colList = rootDir.entryInfoList();
+ TQFileInfoListIterator colIt( *colList );
+ TQFileInfo *colFInfo;
+ TQString cId;
while((colFInfo = colIt.current()))
{
@@ -213,12 +213,12 @@ void KivioStencilSetAction::loadCollections( const QString& rootDirStr )
{
cId = KivioStencilSpawnerSet::readId(colFInfo->absFilePath());
KPopupMenu* ch;
- int index = m_collectionIdList.findIndex(cId);
+ int index = m_collectionIdList.tqfindIndex(cId);
if(index < 0) {
ch = new KPopupMenu;
- connect(ch,SIGNAL(activated(int)),SLOT(slotActivated(int)));
- m_popup->insertItem(QIconSet(dirtPixmap(colFInfo->absFilePath())),
+ connect(ch,TQT_SIGNAL(activated(int)),TQT_SLOT(slotActivated(int)));
+ m_popup->insertItem(TQIconSet(dirtPixmap(colFInfo->absFilePath())),
KivioStencilSpawnerSet::readTitle(colFInfo->absFilePath()),ch);
m_collectionIdList.append(cId);
m_collectionMenuList.append(ch);
@@ -233,45 +233,45 @@ void KivioStencilSetAction::loadCollections( const QString& rootDirStr )
}
}
-void KivioStencilSetAction::loadSet( KPopupMenu* menu, const QString& rootDirStr )
+void KivioStencilSetAction::loadSet( KPopupMenu* menu, const TQString& rootDirStr )
{
- QDir rootDir( rootDirStr );
+ TQDir rootDir( rootDirStr );
- rootDir.setFilter( QDir::Dirs );
- rootDir.setSorting( QDir::Name );
+ rootDir.setFilter( TQDir::Dirs );
+ rootDir.setSorting( TQDir::Name );
- const QFileInfoList *setList = rootDir.entryInfoList();
- QFileInfoListIterator setIt( *setList );
- QFileInfo *setFInfo;
+ const TQFileInfoList *setList = rootDir.entryInfoList();
+ TQFileInfoListIterator setIt( *setList );
+ TQFileInfo *setFInfo;
while( (setFInfo = setIt.current()) )
{
if( setFInfo->fileName() != ".." && setFInfo->fileName() != "." )
{
- menu->insertItem(QIconSet(dirtPixmap(setFInfo->absFilePath())),
+ menu->insertItem(TQIconSet(dirtPixmap(setFInfo->absFilePath())),
KivioStencilSpawnerSet::readTitle(setFInfo->absFilePath()),m_ssId);
- m_pathList.insert( m_ssId, new QString(rootDirStr + "/" + setFInfo->fileName()) );
+ m_pathList.insert( m_ssId, new TQString(rootDirStr + "/" + setFInfo->fileName()) );
m_ssId++;
}
++setIt;
}
}
-QPixmap KivioStencilSetAction::dirtPixmap( const QString& dir )
+TQPixmap KivioStencilSetAction::dirtPixmap( const TQString& dir )
{
- QString fs;
+ TQString fs;
- if( QFile::exists(dir + "/icon.xpm") ) {
+ if( TQFile::exists(dir + "/icon.xpm") ) {
fs = dir + "/icon.xpm";
- } else if( QFile::exists(dir + "/icon.png") ) {
+ } else if( TQFile::exists(dir + "/icon.png") ) {
fs = dir + "/icon.png";
} else {
- return QPixmap( (const char **)default_plug_xpm );
+ return TQPixmap( (const char **)default_plug_xpm );
}
- QFile file( fs );
- QFileInfo finfo( file );
- return QPixmap( finfo.absFilePath() );
+ TQFile file( fs );
+ TQFileInfo finfo( file );
+ return TQPixmap( finfo.absFilePath() );
}
void KivioStencilSetAction::slotActivated(int id)
@@ -279,14 +279,14 @@ void KivioStencilSetAction::slotActivated(int id)
if (id < 0 || !m_pathList.at((uint)id))
return;
- QString path = *m_pathList.at((uint)id);
+ TQString path = *m_pathList.at((uint)id);
emit activated(path);
}
void KivioStencilSetAction::clearCollectionMenuList()
{
- QValueList<KPopupMenu*>::Iterator it;
+ TQValueList<KPopupMenu*>::Iterator it;
for(it = m_collectionMenuList.begin(); it != m_collectionMenuList.end(); ++it) {
KPopupMenu* m = (*it);