summaryrefslogtreecommitdiffstats
path: root/kmenuedit
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
commitc663b6440964f6ac48027143ac9e63298991f9d0 (patch)
tree6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /kmenuedit
parenta061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff)
downloadtdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz
tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmenuedit')
-rw-r--r--kmenuedit/basictab.cpp144
-rw-r--r--kmenuedit/basictab.h12
-rw-r--r--kmenuedit/khotkeys.cpp42
-rw-r--r--kmenuedit/khotkeys.h16
-rw-r--r--kmenuedit/kmenuedit.cpp36
-rw-r--r--kmenuedit/kmenuedit.h8
-rw-r--r--kmenuedit/main.cpp4
-rw-r--r--kmenuedit/menufile.cpp164
-rw-r--r--kmenuedit/menufile.h40
-rw-r--r--kmenuedit/menuinfo.cpp70
-rw-r--r--kmenuedit/menuinfo.h54
-rw-r--r--kmenuedit/treeview.cpp318
-rw-r--r--kmenuedit/treeview.h66
13 files changed, 487 insertions, 487 deletions
diff --git a/kmenuedit/basictab.cpp b/kmenuedit/basictab.cpp
index f6971a1f..1ab175c1 100644
--- a/kmenuedit/basictab.cpp
+++ b/kmenuedit/basictab.cpp
@@ -18,13 +18,13 @@
*/
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qfileinfo.h>
-#include <qgroupbox.h>
-#include <qhbox.h>
-#include <qwhatsthis.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqfileinfo.h>
+#include <tqgroupbox.h>
+#include <tqhbox.h>
+#include <tqwhatsthis.h>
#include <klocale.h>
#include <kstandarddirs.h>
@@ -47,19 +47,19 @@
#include "basictab.h"
#include "basictab.moc"
-BasicTab::BasicTab( QWidget *parent, const char *name )
- : QWidget(parent, name)
+BasicTab::BasicTab( TQWidget *parent, const char *name )
+ : TQWidget(parent, name)
{
_menuFolderInfo = 0;
_menuEntryInfo = 0;
- QGridLayout *layout = new QGridLayout(this, 6, 2,
+ TQGridLayout *layout = new TQGridLayout(this, 6, 2,
KDialog::marginHint(),
KDialog::spacingHint());
// general group
- QGroupBox *general_group = new QGroupBox(this);
- QGridLayout *grid = new QGridLayout(general_group, 5, 2,
+ TQGroupBox *general_group = new TQGroupBox(this);
+ TQGridLayout *grid = new TQGridLayout(general_group, 5, 2,
KDialog::marginHint(),
KDialog::spacingHint());
@@ -74,7 +74,7 @@ BasicTab::BasicTab( QWidget *parent, const char *name )
_commentEdit->setAcceptDrops(false);
_execEdit = new KURLRequester(general_group);
_execEdit->lineEdit()->setAcceptDrops(false);
- QWhatsThis::add(_execEdit,i18n(
+ TQWhatsThis::add(_execEdit,i18n(
"Following the command, you can have several place holders which will be replaced "
"with the actual values when the actual program is run:\n"
"%f - a single file name\n"
@@ -87,32 +87,32 @@ BasicTab::BasicTab( QWidget *parent, const char *name )
"%m - the mini-icon\n"
"%c - the caption"));
- _launchCB = new QCheckBox(i18n("Enable &launch feedback"), general_group);
- _systrayCB = new QCheckBox(i18n("&Place in system tray"), general_group);
+ _launchCB = new TQCheckBox(i18n("Enable &launch feedback"), general_group);
+ _systrayCB = new TQCheckBox(i18n("&Place in system tray"), general_group);
// setup labels
- _nameLabel = new QLabel(_nameEdit, i18n("&Name:"), general_group);
- _descriptionLabel = new QLabel(_descriptionEdit, i18n("&Description:"), general_group);
- _commentLabel = new QLabel(_commentEdit, i18n("&Comment:"), general_group);
- _execLabel = new QLabel(_execEdit, i18n("Co&mmand:"), general_group);
+ _nameLabel = new TQLabel(_nameEdit, i18n("&Name:"), general_group);
+ _descriptionLabel = new TQLabel(_descriptionEdit, i18n("&Description:"), general_group);
+ _commentLabel = new TQLabel(_commentEdit, i18n("&Comment:"), general_group);
+ _execLabel = new TQLabel(_execEdit, i18n("Co&mmand:"), general_group);
grid->addWidget(_nameLabel, 0, 0);
grid->addWidget(_descriptionLabel, 1, 0);
grid->addWidget(_commentLabel, 2, 0);
grid->addWidget(_execLabel, 3, 0);
// connect line inputs
- connect(_nameEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotChanged()));
- connect(_descriptionEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotChanged()));
- connect(_commentEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotChanged()));
- connect(_execEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotChanged()));
- connect(_execEdit, SIGNAL(urlSelected(const QString&)),
- SLOT(slotExecSelected()));
- connect(_launchCB, SIGNAL(clicked()), SLOT(launchcb_clicked()));
- connect(_systrayCB, SIGNAL(clicked()), SLOT(systraycb_clicked()));
+ connect(_nameEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotChanged()));
+ connect(_descriptionEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotChanged()));
+ connect(_commentEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotChanged()));
+ connect(_execEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotChanged()));
+ connect(_execEdit, TQT_SIGNAL(urlSelected(const TQString&)),
+ TQT_SLOT(slotExecSelected()));
+ connect(_launchCB, TQT_SIGNAL(clicked()), TQT_SLOT(launchcb_clicked()));
+ connect(_systrayCB, TQT_SIGNAL(clicked()), TQT_SLOT(systraycb_clicked()));
// add line inputs to the grid
grid->addMultiCellWidget(_nameEdit, 0, 0, 1, 1);
@@ -126,21 +126,21 @@ BasicTab::BasicTab( QWidget *parent, const char *name )
_iconButton = new KIconButton(general_group);
_iconButton->setFixedSize(56,56);
_iconButton->setIconSize(48);
- connect(_iconButton, SIGNAL(iconChanged(QString)), SLOT(slotChanged()));
+ connect(_iconButton, TQT_SIGNAL(iconChanged(TQString)), TQT_SLOT(slotChanged()));
grid->addMultiCellWidget(_iconButton, 0, 1, 2, 2);
// add the general group to the main layout
layout->addMultiCellWidget(general_group, 0, 0, 0, 1);
// path group
- _path_group = new QGroupBox(this);
- QVBoxLayout *vbox = new QVBoxLayout(_path_group, KDialog::marginHint(),
+ _path_group = new TQGroupBox(this);
+ TQVBoxLayout *vbox = new TQVBoxLayout(_path_group, KDialog::marginHint(),
KDialog::spacingHint());
- QHBox *hbox = new QHBox(_path_group);
+ TQHBox *hbox = new TQHBox(_path_group);
hbox->setSpacing(KDialog::spacingHint());
- _pathLabel = new QLabel(i18n("&Work path:"), hbox);
+ _pathLabel = new TQLabel(i18n("&Work path:"), hbox);
_pathEdit = new KURLRequester(hbox);
_pathEdit->setMode(KFile::Directory | KFile::LocalOnly);
@@ -148,52 +148,52 @@ BasicTab::BasicTab( QWidget *parent, const char *name )
_pathLabel->setBuddy(_pathEdit);
- connect(_pathEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotChanged()));
+ connect(_pathEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotChanged()));
vbox->addWidget(hbox);
layout->addMultiCellWidget(_path_group, 1, 1, 0, 1);
// terminal group
- _term_group = new QGroupBox(this);
- vbox = new QVBoxLayout(_term_group, KDialog::marginHint(),
+ _term_group = new TQGroupBox(this);
+ vbox = new TQVBoxLayout(_term_group, KDialog::marginHint(),
KDialog::spacingHint());
- _terminalCB = new QCheckBox(i18n("Run in term&inal"), _term_group);
- connect(_terminalCB, SIGNAL(clicked()), SLOT(termcb_clicked()));
+ _terminalCB = new TQCheckBox(i18n("Run in term&inal"), _term_group);
+ connect(_terminalCB, TQT_SIGNAL(clicked()), TQT_SLOT(termcb_clicked()));
vbox->addWidget(_terminalCB);
- hbox = new QHBox(_term_group);
+ hbox = new TQHBox(_term_group);
hbox->setSpacing(KDialog::spacingHint());
- _termOptLabel = new QLabel(i18n("Terminal &options:"), hbox);
+ _termOptLabel = new TQLabel(i18n("Terminal &options:"), hbox);
_termOptEdit = new KLineEdit(hbox);
_termOptEdit->setAcceptDrops(false);
_termOptLabel->setBuddy(_termOptEdit);
- connect(_termOptEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotChanged()));
+ connect(_termOptEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotChanged()));
vbox->addWidget(hbox);
layout->addMultiCellWidget(_term_group, 2, 2, 0, 1);
_termOptEdit->setEnabled(false);
// uid group
- _uid_group = new QGroupBox(this);
- vbox = new QVBoxLayout(_uid_group, KDialog::marginHint(),
+ _uid_group = new TQGroupBox(this);
+ vbox = new TQVBoxLayout(_uid_group, KDialog::marginHint(),
KDialog::spacingHint());
- _uidCB = new QCheckBox(i18n("&Run as a different user"), _uid_group);
- connect(_uidCB, SIGNAL(clicked()), SLOT(uidcb_clicked()));
+ _uidCB = new TQCheckBox(i18n("&Run as a different user"), _uid_group);
+ connect(_uidCB, TQT_SIGNAL(clicked()), TQT_SLOT(uidcb_clicked()));
vbox->addWidget(_uidCB);
- hbox = new QHBox(_uid_group);
+ hbox = new TQHBox(_uid_group);
hbox->setSpacing(KDialog::spacingHint());
- _uidLabel = new QLabel(i18n("&Username:"), hbox);
+ _uidLabel = new TQLabel(i18n("&Username:"), hbox);
_uidEdit = new KLineEdit(hbox);
_uidEdit->setAcceptDrops(false);
_uidLabel->setBuddy(_uidEdit);
- connect(_uidEdit, SIGNAL(textChanged(const QString&)),
- SLOT(slotChanged()));
+ connect(_uidEdit, TQT_SIGNAL(textChanged(const TQString&)),
+ TQT_SLOT(slotChanged()));
vbox->addWidget(hbox);
layout->addMultiCellWidget(_uid_group, 3, 3, 0, 1);
@@ -202,25 +202,25 @@ BasicTab::BasicTab( QWidget *parent, const char *name )
layout->setRowStretch(0, 2);
// key binding group
- general_group_keybind = new QGroupBox(this);
+ general_group_keybind = new TQGroupBox(this);
layout->addMultiCellWidget( general_group_keybind, 4, 4, 0, 1 );
// dummy widget in order to make it look a bit better
- layout->addWidget( new QWidget(this), 5, 0 );
+ layout->addWidget( new TQWidget(this), 5, 0 );
layout->setRowStretch( 5, 4 );
- QGridLayout *grid_keybind = new QGridLayout(general_group_keybind, 3, 1,
+ TQGridLayout *grid_keybind = new TQGridLayout(general_group_keybind, 3, 1,
KDialog::marginHint(),
KDialog::spacingHint());
//_keyEdit = new KLineEdit(general_group_keybind);
//_keyEdit->setReadOnly( true );
//_keyEdit->setText( "" );
- //QPushButton* _keyButton = new QPushButton( i18n( "Change" ),
+ //TQPushButton* _keyButton = new TQPushButton( i18n( "Change" ),
// general_group_keybind );
- //connect( _keyButton, SIGNAL( clicked()), this, SLOT( keyButtonPressed()));
+ //connect( _keyButton, TQT_SIGNAL( clicked()), this, TQT_SLOT( keyButtonPressed()));
_keyEdit = new KKeyButton(general_group_keybind);
- grid_keybind->addWidget(new QLabel(_keyEdit, i18n("Current shortcut &key:"), general_group_keybind), 0, 0);
- connect( _keyEdit, SIGNAL(capturedShortcut(const KShortcut&)),
- this, SLOT(slotCapturedShortcut(const KShortcut&)));
+ grid_keybind->addWidget(new TQLabel(_keyEdit, i18n("Current shortcut &key:"), general_group_keybind), 0, 0);
+ connect( _keyEdit, TQT_SIGNAL(capturedShortcut(const KShortcut&)),
+ this, TQT_SLOT(slotCapturedShortcut(const KShortcut&)));
grid_keybind->addWidget(_keyEdit, 0, 1);
//grid_keybind->addWidget(_keyButton, 0, 2 );
@@ -315,19 +315,19 @@ void BasicTab::setEntryInfo(MenuEntryInfo *entryInfo)
if (!entryInfo)
{
- _nameEdit->setText(QString::null);
- _descriptionEdit->setText(QString::null);
- _commentEdit->setText(QString::null);
- _iconButton->setIcon(QString::null);
+ _nameEdit->setText(TQString::null);
+ _descriptionEdit->setText(TQString::null);
+ _commentEdit->setText(TQString::null);
+ _iconButton->setIcon(TQString::null);
// key binding part
_keyEdit->setShortcut( KShortcut(), false );
- _execEdit->lineEdit()->setText(QString::null);
+ _execEdit->lineEdit()->setText(TQString::null);
_systrayCB->setChecked(false);
- _pathEdit->lineEdit()->setText(QString::null);
- _termOptEdit->setText(QString::null);
- _uidEdit->setText(QString::null);
+ _pathEdit->lineEdit()->setText(TQString::null);
+ _termOptEdit->setText(TQString::null);
+ _uidEdit->setText(TQString::null);
_launchCB->setChecked(false);
_terminalCB->setChecked(false);
@@ -352,7 +352,7 @@ void BasicTab::setEntryInfo(MenuEntryInfo *entryInfo)
_keyEdit->setShortcut( entryInfo->shortcut(), false );
}
- QString temp = df->readPathEntry("Exec");
+ TQString temp = df->readPathEntry("Exec");
if (temp.left(12) == "ksystraycmd ")
{
_execEdit->lineEdit()->setText(temp.right(temp.length()-12));
@@ -458,7 +458,7 @@ void BasicTab::uidcb_clicked()
void BasicTab::slotExecSelected()
{
- QString path = _execEdit->lineEdit()->text();
+ TQString path = _execEdit->lineEdit()->text();
if (!path.startsWith("'"))
_execEdit->lineEdit()->setText(KProcess::quote(path));
}
diff --git a/kmenuedit/basictab.h b/kmenuedit/basictab.h
index 6f6bb63a..7b0bd555 100644
--- a/kmenuedit/basictab.h
+++ b/kmenuedit/basictab.h
@@ -20,8 +20,8 @@
#ifndef __basictab_h__
#define __basictab_h__
-#include <qwidget.h>
-#include <qstring.h>
+#include <tqwidget.h>
+#include <tqstring.h>
#include <klineedit.h>
@@ -43,7 +43,7 @@ class BasicTab : public QWidget
Q_OBJECT
public:
- BasicTab( QWidget *parent=0, const char *name=0 );
+ BasicTab( TQWidget *parent=0, const char *name=0 );
void apply();
signals:
@@ -73,10 +73,10 @@ protected:
KKeyButton *_keyEdit;
KURLRequester *_execEdit, *_pathEdit;
KLineEdit *_termOptEdit, *_uidEdit;
- QCheckBox *_terminalCB, *_uidCB, *_launchCB, *_systrayCB;
+ TQCheckBox *_terminalCB, *_uidCB, *_launchCB, *_systrayCB;
KIconButton *_iconButton;
- QGroupBox *_path_group, *_term_group, *_uid_group, *general_group_keybind;
- QLabel *_termOptLabel, *_uidLabel, *_pathLabel, *_nameLabel, *_commentLabel, *_execLabel;
+ TQGroupBox *_path_group, *_term_group, *_uid_group, *general_group_keybind;
+ TQLabel *_termOptLabel, *_uidLabel, *_pathLabel, *_nameLabel, *_commentLabel, *_execLabel;
QLabel *_descriptionLabel;
MenuFolderInfo *_menuFolderInfo;
diff --git a/kmenuedit/khotkeys.cpp b/kmenuedit/khotkeys.cpp
index 65909ab7..9b0ead3c 100644
--- a/kmenuedit/khotkeys.cpp
+++ b/kmenuedit/khotkeys.cpp
@@ -25,13 +25,13 @@ extern "C"
{
static void (*khotkeys_init_2)( void );
static void (*khotkeys_cleanup_2)( void );
- static QString (*khotkeys_get_menu_entry_shortcut_2)( const QString& entry_P );
- static QString (*khotkeys_change_menu_entry_shortcut_2)( const QString& entry_P,
- const QString& shortcut_P );
- static bool (*khotkeys_menu_entry_moved_2)( const QString& new_P, const QString& old_P );
- static void (*khotkeys_menu_entry_deleted_2)( const QString& entry_P );
- static QStringList (*khotkeys_get_all_shortcuts_2)( );
- static KService::Ptr (*khotkeys_find_menu_entry_2)( const QString& shortcut_P );
+ static TQString (*khotkeys_get_menu_entry_shortcut_2)( const TQString& entry_P );
+ static TQString (*khotkeys_change_menu_entry_shortcut_2)( const TQString& entry_P,
+ const TQString& shortcut_P );
+ static bool (*khotkeys_menu_entry_moved_2)( const TQString& new_P, const TQString& old_P );
+ static void (*khotkeys_menu_entry_deleted_2)( const TQString& entry_P );
+ static TQStringList (*khotkeys_get_all_shortcuts_2)( );
+ static KService::Ptr (*khotkeys_find_menu_entry_2)( const TQString& shortcut_P );
}
static bool khotkeys_present = false;
@@ -46,22 +46,22 @@ bool KHotKeys::init()
khotkeys_init_2 = ( void (*)(void)) ( lib->symbol( "khotkeys_init" ));
khotkeys_cleanup_2 = ( void (*)(void)) ( lib->symbol( "khotkeys_cleanup" ));
khotkeys_get_menu_entry_shortcut_2 =
- ( QString (*)( const QString& ))
+ ( TQString (*)( const TQString& ))
( lib->symbol( "khotkeys_get_menu_entry_shortcut" ));
khotkeys_change_menu_entry_shortcut_2 =
- ( QString (*)( const QString&, const QString& ))
+ ( TQString (*)( const TQString&, const TQString& ))
( lib->symbol( "khotkeys_change_menu_entry_shortcut" ));
khotkeys_menu_entry_moved_2 =
- ( bool (*)( const QString&, const QString& ))
+ ( bool (*)( const TQString&, const TQString& ))
( lib->symbol( "khotkeys_menu_entry_moved" ));
khotkeys_menu_entry_deleted_2 =
- ( void (*)( const QString& ))
+ ( void (*)( const TQString& ))
( lib->symbol( "khotkeys_menu_entry_deleted" ));
khotkeys_get_all_shortcuts_2 =
- ( QStringList (*)( ))
+ ( TQStringList (*)( ))
( lib->symbol( "khotkeys_get_all_shortcuts" ));
khotkeys_find_menu_entry_2 =
- ( KService::Ptr (*)( const QString& ))
+ ( KService::Ptr (*)( const TQString& ))
( lib->symbol( "khotkeys_find_menu_entry" ));
if( khotkeys_init_2
@@ -92,7 +92,7 @@ bool KHotKeys::present()
return khotkeys_present;
}
-QString KHotKeys::getMenuEntryShortcut( const QString& entry_P )
+TQString KHotKeys::getMenuEntryShortcut( const TQString& entry_P )
{
if( !khotkeys_inited )
init();
@@ -101,8 +101,8 @@ QString KHotKeys::getMenuEntryShortcut( const QString& entry_P )
return khotkeys_get_menu_entry_shortcut_2( entry_P );
}
-QString KHotKeys::changeMenuEntryShortcut( const QString& entry_P,
- const QString shortcut_P )
+TQString KHotKeys::changeMenuEntryShortcut( const TQString& entry_P,
+ const TQString shortcut_P )
{
if( !khotkeys_inited )
init();
@@ -111,7 +111,7 @@ QString KHotKeys::changeMenuEntryShortcut( const QString& entry_P,
return khotkeys_change_menu_entry_shortcut_2( entry_P, shortcut_P );
}
-bool KHotKeys::menuEntryMoved( const QString& new_P, const QString& old_P )
+bool KHotKeys::menuEntryMoved( const TQString& new_P, const TQString& old_P )
{
if( !khotkeys_inited )
init();
@@ -120,7 +120,7 @@ bool KHotKeys::menuEntryMoved( const QString& new_P, const QString& old_P )
return khotkeys_menu_entry_moved_2( new_P, old_P );
}
-void KHotKeys::menuEntryDeleted( const QString& entry_P )
+void KHotKeys::menuEntryDeleted( const TQString& entry_P )
{
if( !khotkeys_inited )
init();
@@ -129,16 +129,16 @@ void KHotKeys::menuEntryDeleted( const QString& entry_P )
khotkeys_menu_entry_deleted_2( entry_P );
}
-QStringList KHotKeys::allShortCuts( )
+TQStringList KHotKeys::allShortCuts( )
{
if( !khotkeys_inited )
init();
if (!khotkeys_get_all_shortcuts_2)
- return QStringList();
+ return TQStringList();
return khotkeys_get_all_shortcuts_2();
}
-KService::Ptr KHotKeys::findMenuEntry( const QString &shortcut_P )
+KService::Ptr KHotKeys::findMenuEntry( const TQString &shortcut_P )
{
if( !khotkeys_inited )
init();
diff --git a/kmenuedit/khotkeys.h b/kmenuedit/khotkeys.h
index 15aaeeb6..ebf40451 100644
--- a/kmenuedit/khotkeys.h
+++ b/kmenuedit/khotkeys.h
@@ -21,7 +21,7 @@
#ifndef __khotkeys_public_h__
#define __khotkeys_public_h__
-#include <qstring.h>
+#include <tqstring.h>
#include <kservice.h>
// see kdebase/khotkeys/kcontrol for info on these
@@ -32,13 +32,13 @@ public:
static bool init();
static void cleanup();
static bool present();
- static QString getMenuEntryShortcut( const QString& entry_P );
- static QString changeMenuEntryShortcut( const QString& entry_P,
- const QString shortcut_P );
- static bool menuEntryMoved( const QString& new_P, const QString& old_P );
- static void menuEntryDeleted( const QString& entry_P );
- static QStringList allShortCuts( );
- static KService::Ptr findMenuEntry( const QString &shortcut_P );
+ static TQString getMenuEntryShortcut( const TQString& entry_P );
+ static TQString changeMenuEntryShortcut( const TQString& entry_P,
+ const TQString shortcut_P );
+ static bool menuEntryMoved( const TQString& new_P, const TQString& old_P );
+ static void menuEntryDeleted( const TQString& entry_P );
+ static TQStringList allShortCuts( );
+ static KService::Ptr findMenuEntry( const TQString &shortcut_P );
};
#endif
diff --git a/kmenuedit/kmenuedit.cpp b/kmenuedit/kmenuedit.cpp
index ba8d6fc0..9474d85e 100644
--- a/kmenuedit/kmenuedit.cpp
+++ b/kmenuedit/kmenuedit.cpp
@@ -18,7 +18,7 @@
*
*/
-#include <qsplitter.h>
+#include <tqsplitter.h>
#include <kaction.h>
#include <kapplication.h>
@@ -37,7 +37,7 @@
#include "kmenuedit.h"
#include "kmenuedit.moc"
-KMenuEdit::KMenuEdit (bool controlCenter, QWidget *, const char *name)
+KMenuEdit::KMenuEdit (bool controlCenter, TQWidget *, const char *name)
: KMainWindow (0, name), m_tree(0), m_basicTab(0), m_splitter(0), m_controlCenter(controlCenter)
{
#if 0
@@ -69,8 +69,8 @@ void KMenuEdit::setupActions()
m_actionDelete = 0;
- KStdAction::save(this, SLOT( slotSave() ), actionCollection());
- KStdAction::quit(this, SLOT( close() ), actionCollection());
+ KStdAction::save(this, TQT_SLOT( slotSave() ), actionCollection());
+ KStdAction::quit(this, TQT_SLOT( close() ), actionCollection());
KStdAction::cut(0, 0, actionCollection());
KStdAction::copy(0, 0, actionCollection());
KStdAction::paste(0, 0, actionCollection());
@@ -78,29 +78,29 @@ void KMenuEdit::setupActions()
void KMenuEdit::setupView()
{
- m_splitter = new QSplitter(Horizontal, this);
+ m_splitter = new TQSplitter(Horizontal, this);
m_tree = new TreeView(m_controlCenter, actionCollection(), m_splitter);
m_basicTab = new BasicTab(m_splitter);
- connect(m_tree, SIGNAL(entrySelected(MenuFolderInfo *)),
- m_basicTab, SLOT(setFolderInfo(MenuFolderInfo *)));
- connect(m_tree, SIGNAL(entrySelected(MenuEntryInfo *)),
- m_basicTab, SLOT(setEntryInfo(MenuEntryInfo *)));
- connect(m_tree, SIGNAL(disableAction()),
- m_basicTab, SLOT(slotDisableAction() ) );
+ connect(m_tree, TQT_SIGNAL(entrySelected(MenuFolderInfo *)),
+ m_basicTab, TQT_SLOT(setFolderInfo(MenuFolderInfo *)));
+ connect(m_tree, TQT_SIGNAL(entrySelected(MenuEntryInfo *)),
+ m_basicTab, TQT_SLOT(setEntryInfo(MenuEntryInfo *)));
+ connect(m_tree, TQT_SIGNAL(disableAction()),
+ m_basicTab, TQT_SLOT(slotDisableAction() ) );
- connect(m_basicTab, SIGNAL(changed(MenuFolderInfo *)),
- m_tree, SLOT(currentChanged(MenuFolderInfo *)));
+ connect(m_basicTab, TQT_SIGNAL(changed(MenuFolderInfo *)),
+ m_tree, TQT_SLOT(currentChanged(MenuFolderInfo *)));
- connect(m_basicTab, SIGNAL(changed(MenuEntryInfo *)),
- m_tree, SLOT(currentChanged(MenuEntryInfo *)));
+ connect(m_basicTab, TQT_SIGNAL(changed(MenuEntryInfo *)),
+ m_tree, TQT_SLOT(currentChanged(MenuEntryInfo *)));
- connect(m_basicTab, SIGNAL(findServiceShortcut(const KShortcut&, KService::Ptr &)),
- m_tree, SLOT(findServiceShortcut(const KShortcut&, KService::Ptr &)));
+ connect(m_basicTab, TQT_SIGNAL(findServiceShortcut(const KShortcut&, KService::Ptr &)),
+ m_tree, TQT_SLOT(findServiceShortcut(const KShortcut&, KService::Ptr &)));
// restore splitter sizes
KConfig* config = KGlobal::config();
- QValueList<int> sizes = config->readIntListEntry("SplitterSizes");
+ TQValueList<int> sizes = config->readIntListEntry("SplitterSizes");
if (sizes.isEmpty())
sizes << 1 << 3;
diff --git a/kmenuedit/kmenuedit.h b/kmenuedit/kmenuedit.h
index 32e860e0..2d95b6e3 100644
--- a/kmenuedit/kmenuedit.h
+++ b/kmenuedit/kmenuedit.h
@@ -33,11 +33,11 @@ class KMenuEdit : public KMainWindow
Q_OBJECT
public:
- KMenuEdit( bool controlCenter, QWidget *parent=0, const char *name=0 );
+ KMenuEdit( bool controlCenter, TQWidget *parent=0, const char *name=0 );
~KMenuEdit();
- void selectMenu(const QString &menu) { m_tree->selectMenu(menu); }
- void selectMenuEntry(const QString &menuEntry) { m_tree->selectMenuEntry(menuEntry); }
+ void selectMenu(const TQString &menu) { m_tree->selectMenu(menu); }
+ void selectMenuEntry(const TQString &menuEntry) { m_tree->selectMenuEntry(menuEntry); }
protected:
void setupView();
@@ -51,7 +51,7 @@ protected slots:
protected:
TreeView *m_tree;
BasicTab *m_basicTab;
- QSplitter *m_splitter;
+ TQSplitter *m_splitter;
KAction *m_actionDelete;
KToggleAction *m_actionShowHidden;
diff --git a/kmenuedit/main.cpp b/kmenuedit/main.cpp
index abb4f596..81d1c7e5 100644
--- a/kmenuedit/main.cpp
+++ b/kmenuedit/main.cpp
@@ -51,10 +51,10 @@ public:
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args->count() > 0)
{
- menuEdit->selectMenu(QString::fromLocal8Bit(args->arg(0)));
+ menuEdit->selectMenu(TQString::fromLocal8Bit(args->arg(0)));
if (args->count() > 1)
{
- menuEdit->selectMenuEntry(QString::fromLocal8Bit(args->arg(1)));
+ menuEdit->selectMenuEntry(TQString::fromLocal8Bit(args->arg(1)));
}
}
return KUniqueApplication::newInstance();
diff --git a/kmenuedit/menufile.cpp b/kmenuedit/menufile.cpp
index 7fe2be95..d1582c23 100644
--- a/kmenuedit/menufile.cpp
+++ b/kmenuedit/menufile.cpp
@@ -16,9 +16,9 @@
*
*/
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qregexp.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
#include <kdebug.h>
#include <kglobal.h>
@@ -46,7 +46,7 @@
#define MF_SEPARATOR "Separator"
#define MF_MERGE "Merge"
-MenuFile::MenuFile(const QString &file)
+MenuFile::MenuFile(const TQString &file)
: m_fileName(file), m_bDirty(false)
{
load();
@@ -61,7 +61,7 @@ bool MenuFile::load()
if (m_fileName.isEmpty())
return false;
- QFile file( m_fileName );
+ TQFile file( m_fileName );
if (!file.open( IO_ReadOnly ))
{
kdWarning() << "Could not read " << m_fileName << endl;
@@ -69,7 +69,7 @@ bool MenuFile::load()
return false;
}
- QString errorMsg;
+ TQString errorMsg;
int errorRow;
int errorCol;
if ( !m_doc.setContent( &file, &errorMsg, &errorRow, &errorCol ) ) {
@@ -85,14 +85,14 @@ bool MenuFile::load()
void MenuFile::create()
{
- QDomImplementation impl;
- QDomDocumentType docType = impl.createDocumentType( MF_MENU, MF_PUBLIC_ID, MF_SYSTEM_ID );
- m_doc = impl.createDocument(QString::null, MF_MENU, docType);
+ TQDomImplementation impl;
+ TQDomDocumentType docType = impl.createDocumentType( MF_MENU, MF_PUBLIC_ID, MF_SYSTEM_ID );
+ m_doc = impl.createDocument(TQString::null, MF_MENU, docType);
}
bool MenuFile::save()
{
- QFile file( m_fileName );
+ TQFile file( m_fileName );
if (!file.open( IO_WriteOnly ))
{
@@ -100,8 +100,8 @@ bool MenuFile::save()
m_error = i18n("Could not write to %1").arg(m_fileName);
return false;
}
- QTextStream stream( &file );
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream( &file );
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
stream << m_doc.toString();
@@ -119,10 +119,10 @@ bool MenuFile::save()
return true;
}
-QDomElement MenuFile::findMenu(QDomElement elem, const QString &menuName, bool create)
+TQDomElement MenuFile::findMenu(TQDomElement elem, const TQString &menuName, bool create)
{
- QString menuNodeName;
- QString subMenuName;
+ TQString menuNodeName;
+ TQString subMenuName;
int i = menuName.find('/');
if (i >= 0)
{
@@ -139,18 +139,18 @@ QDomElement MenuFile::findMenu(QDomElement elem, const QString &menuName, bool c
if (menuNodeName.isEmpty())
return elem;
- QDomNode n = elem.firstChild();
+ TQDomNode n = elem.firstChild();
while( !n.isNull() )
{
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if (e.tagName() == MF_MENU)
{
- QString name;
+ TQString name;
- QDomNode n2 = e.firstChild();
+ TQDomNode n2 = e.firstChild();
while ( !n2.isNull() )
{
- QDomElement e2 = n2.toElement();
+ TQDomElement e2 = n2.toElement();
if (!e2.isNull() && e2.tagName() == MF_NAME)
{
name = e2.text();
@@ -171,11 +171,11 @@ QDomElement MenuFile::findMenu(QDomElement elem, const QString &menuName, bool c
}
if (!create)
- return QDomElement();
+ return TQDomElement();
// Create new node.
- QDomElement newElem = m_doc.createElement(MF_MENU);
- QDomElement newNameElem = m_doc.createElement(MF_NAME);
+ TQDomElement newElem = m_doc.createElement(MF_MENU);
+ TQDomElement newNameElem = m_doc.createElement(MF_NAME);
newNameElem.appendChild(m_doc.createTextNode(menuNodeName));
newElem.appendChild(newNameElem);
elem.appendChild(newElem);
@@ -186,10 +186,10 @@ QDomElement MenuFile::findMenu(QDomElement elem, const QString &menuName, bool c
return findMenu(newElem, subMenuName, create);
}
-static QString entryToDirId(const QString &path)
+static TQString entryToDirId(const TQString &path)
{
// See also KDesktopFile::locateLocal
- QString local;
+ TQString local;
if (path.startsWith("/"))
{
// XDG Desktop menu items come with absolute paths, we need to
@@ -205,13 +205,13 @@ static QString entryToDirId(const QString &path)
return local;
}
-static void purgeIncludesExcludes(QDomElement elem, const QString &appId, QDomElement &excludeNode, QDomElement &includeNode)
+static void purgeIncludesExcludes(TQDomElement elem, const TQString &appId, TQDomElement &excludeNode, TQDomElement &includeNode)
{
// Remove any previous includes/excludes of appId
- QDomNode n = elem.firstChild();
+ TQDomNode n = elem.firstChild();
while( !n.isNull() )
{
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
bool bIncludeNode = (e.tagName() == MF_INCLUDE);
bool bExcludeNode = (e.tagName() == MF_EXCLUDE);
if (bIncludeNode)
@@ -220,11 +220,11 @@ static void purgeIncludesExcludes(QDomElement elem, const QString &appId, QDomEl
excludeNode = e;
if (bIncludeNode || bExcludeNode)
{
- QDomNode n2 = e.firstChild();
+ TQDomNode n2 = e.firstChild();
while ( !n2.isNull() )
{
- QDomNode next = n2.nextSibling();
- QDomElement e2 = n2.toElement();
+ TQDomNode next = n2.nextSibling();
+ TQDomElement e2 = n2.toElement();
if (!e2.isNull() && e2.tagName() == MF_FILENAME)
{
if (e2.text() == appId)
@@ -240,14 +240,14 @@ static void purgeIncludesExcludes(QDomElement elem, const QString &appId, QDomEl
}
}
-static void purgeDeleted(QDomElement elem)
+static void purgeDeleted(TQDomElement elem)
{
// Remove any previous includes/excludes of appId
- QDomNode n = elem.firstChild();
+ TQDomNode n = elem.firstChild();
while( !n.isNull() )
{
- QDomNode next = n.nextSibling();
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomNode next = n.nextSibling();
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if ((e.tagName() == MF_DELETED) ||
(e.tagName() == MF_NOTDELETED))
{
@@ -257,14 +257,14 @@ static void purgeDeleted(QDomElement elem)
}
}
-static void purgeLayout(QDomElement elem)
+static void purgeLayout(TQDomElement elem)
{
// Remove any previous includes/excludes of appId
- QDomNode n = elem.firstChild();
+ TQDomNode n = elem.firstChild();
while( !n.isNull() )
{
- QDomNode next = n.nextSibling();
- QDomElement e = n.toElement(); // try to convert the node to an element.
+ TQDomNode next = n.nextSibling();
+ TQDomElement e = n.toElement(); // try to convert the node to an element.
if (e.tagName() == MF_LAYOUT)
{
elem.removeChild(e);
@@ -273,16 +273,16 @@ static void purgeLayout(QDomElement elem)
}
}
-void MenuFile::addEntry(const QString &menuName, const QString &menuId)
+void MenuFile::addEntry(const TQString &menuName, const TQString &menuId)
{
m_bDirty = true;
m_removedEntries.remove(menuId);
- QDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
+ TQDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
- QDomElement excludeNode;
- QDomElement includeNode;
+ TQDomElement excludeNode;
+ TQDomElement includeNode;
purgeIncludesExcludes(elem, menuId, excludeNode, includeNode);
@@ -292,58 +292,58 @@ void MenuFile::addEntry(const QString &menuName, const QString &menuId)
elem.appendChild(includeNode);
}
- QDomElement fileNode = m_doc.createElement(MF_FILENAME);
+ TQDomElement fileNode = m_doc.createElement(MF_FILENAME);
fileNode.appendChild(m_doc.createTextNode(menuId));
includeNode.appendChild(fileNode);
}
-void MenuFile::setLayout(const QString &menuName, const QStringList &layout)
+void MenuFile::setLayout(const TQString &menuName, const TQStringList &layout)
{
m_bDirty = true;
- QDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
+ TQDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
purgeLayout(elem);
- QDomElement layoutNode = m_doc.createElement(MF_LAYOUT);
+ TQDomElement layoutNode = m_doc.createElement(MF_LAYOUT);
elem.appendChild(layoutNode);
- for(QStringList::ConstIterator it = layout.begin();
+ for(TQStringList::ConstIterator it = layout.begin();
it != layout.end(); ++it)
{
- QString li = *it;
+ TQString li = *it;
if (li == ":S")
{
layoutNode.appendChild(m_doc.createElement(MF_SEPARATOR));
}
else if (li == ":M")
{
- QDomElement mergeNode = m_doc.createElement(MF_MERGE);
+ TQDomElement mergeNode = m_doc.createElement(MF_MERGE);
mergeNode.setAttribute("type", "menus");
layoutNode.appendChild(mergeNode);
}
else if (li == ":F")
{
- QDomElement mergeNode = m_doc.createElement(MF_MERGE);
+ TQDomElement mergeNode = m_doc.createElement(MF_MERGE);
mergeNode.setAttribute("type", "files");
layoutNode.appendChild(mergeNode);
}
else if (li == ":A")
{
- QDomElement mergeNode = m_doc.createElement(MF_MERGE);
+ TQDomElement mergeNode = m_doc.createElement(MF_MERGE);
mergeNode.setAttribute("type", "all");
layoutNode.appendChild(mergeNode);
}
else if (li.endsWith("/"))
{
li.truncate(li.length()-1);
- QDomElement menuNode = m_doc.createElement(MF_MENUNAME);
+ TQDomElement menuNode = m_doc.createElement(MF_MENUNAME);
menuNode.appendChild(m_doc.createTextNode(li));
layoutNode.appendChild(menuNode);
}
else
{
- QDomElement fileNode = m_doc.createElement(MF_FILENAME);
+ TQDomElement fileNode = m_doc.createElement(MF_FILENAME);
fileNode.appendChild(m_doc.createTextNode(li));
layoutNode.appendChild(fileNode);
}
@@ -351,16 +351,16 @@ void MenuFile::setLayout(const QString &menuName, const QStringList &layout)
}
-void MenuFile::removeEntry(const QString &menuName, const QString &menuId)
+void MenuFile::removeEntry(const TQString &menuName, const TQString &menuId)
{
m_bDirty = true;
m_removedEntries.append(menuId);
- QDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
+ TQDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
- QDomElement excludeNode;
- QDomElement includeNode;
+ TQDomElement excludeNode;
+ TQDomElement includeNode;
purgeIncludesExcludes(elem, menuId, excludeNode, includeNode);
@@ -370,35 +370,35 @@ void MenuFile::removeEntry(const QString &menuName, const QString &menuId)
elem.appendChild(excludeNode);
}
- QDomElement fileNode = m_doc.createElement(MF_FILENAME);
+ TQDomElement fileNode = m_doc.createElement(MF_FILENAME);
fileNode.appendChild(m_doc.createTextNode(menuId));
excludeNode.appendChild(fileNode);
}
-void MenuFile::addMenu(const QString &menuName, const QString &menuFile)
+void MenuFile::addMenu(const TQString &menuName, const TQString &menuFile)
{
m_bDirty = true;
- QDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
+ TQDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
- QDomElement dirElem = m_doc.createElement(MF_DIRECTORY);
+ TQDomElement dirElem = m_doc.createElement(MF_DIRECTORY);
dirElem.appendChild(m_doc.createTextNode(entryToDirId(menuFile)));
elem.appendChild(dirElem);
}
-void MenuFile::moveMenu(const QString &oldMenu, const QString &newMenu)
+void MenuFile::moveMenu(const TQString &oldMenu, const TQString &newMenu)
{
m_bDirty = true;
// Undelete the new menu
- QDomElement elem = findMenu(m_doc.documentElement(), newMenu, true);
+ TQDomElement elem = findMenu(m_doc.documentElement(), newMenu, true);
purgeDeleted(elem);
elem.appendChild(m_doc.createElement(MF_NOTDELETED));
// TODO: GET RID OF COMMON PART, IT BREAKS STUFF
// Find common part
- QStringList oldMenuParts = QStringList::split('/', oldMenu);
- QStringList newMenuParts = QStringList::split('/', newMenu);
- QString commonMenuName;
+ TQStringList oldMenuParts = TQStringList::split('/', oldMenu);
+ TQStringList newMenuParts = TQStringList::split('/', newMenu);
+ TQString commonMenuName;
uint max = QMIN(oldMenuParts.count(), newMenuParts.count());
uint i = 0;
for(; i < max; i++)
@@ -407,14 +407,14 @@ void MenuFile::moveMenu(const QString &oldMenu, const QString &newMenu)
break;
commonMenuName += '/' + oldMenuParts[i];
}
- QString oldMenuName;
+ TQString oldMenuName;
for(uint j = i; j < oldMenuParts.count(); j++)
{
if (i != j)
oldMenuName += '/';
oldMenuName += oldMenuParts[j];
}
- QString newMenuName;
+ TQString newMenuName;
for(uint j = i; j < newMenuParts.count(); j++)
{
if (i != j)
@@ -427,8 +427,8 @@ void MenuFile::moveMenu(const QString &oldMenu, const QString &newMenu)
elem = findMenu(m_doc.documentElement(), commonMenuName, true);
// Add instructions for moving
- QDomElement moveNode = m_doc.createElement(MF_MOVE);
- QDomElement node = m_doc.createElement(MF_OLD);
+ TQDomElement moveNode = m_doc.createElement(MF_MOVE);
+ TQDomElement node = m_doc.createElement(MF_OLD);
node.appendChild(m_doc.createTextNode(oldMenuName));
moveNode.appendChild(node);
node = m_doc.createElement(MF_NEW);
@@ -437,11 +437,11 @@ void MenuFile::moveMenu(const QString &oldMenu, const QString &newMenu)
elem.appendChild(moveNode);
}
-void MenuFile::removeMenu(const QString &menuName)
+void MenuFile::removeMenu(const TQString &menuName)
{
m_bDirty = true;
- QDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
+ TQDomElement elem = findMenu(m_doc.documentElement(), menuName, true);
purgeDeleted(elem);
elem.appendChild(m_doc.createElement(MF_DELETED));
@@ -451,15 +451,15 @@ void MenuFile::removeMenu(const QString &menuName)
* Returns a unique menu-name for a new menu under @p menuName
* inspired by @p newMenu
*/
-QString MenuFile::uniqueMenuName(const QString &menuName, const QString &newMenu, const QStringList & excludeList)
+TQString MenuFile::uniqueMenuName(const TQString &menuName, const TQString &newMenu, const TQStringList & excludeList)
{
- QDomElement elem = findMenu(m_doc.documentElement(), menuName, false);
+ TQDomElement elem = findMenu(m_doc.documentElement(), menuName, false);
- QString result = newMenu;
+ TQString result = newMenu;
if (result.endsWith("/"))
result.truncate(result.length()-1);
- QRegExp r("(.*)(?=-\\d+)");
+ TQRegExp r("(.*)(?=-\\d+)");
result = (r.search(result) > -1) ? r.cap(1) : result;
int trunc = result.length(); // Position of trailing '/'
@@ -472,9 +472,9 @@ QString MenuFile::uniqueMenuName(const QString &menuName, const QString &newMenu
return result;
result.truncate(trunc);
- result.append(QString("-%1/").arg(n));
+ result.append(TQString("-%1/").arg(n));
}
- return QString::null; // Never reached
+ return TQString::null; // Never reached
}
void MenuFile::performAction(const ActionAtom *atom)
@@ -499,7 +499,7 @@ void MenuFile::performAction(const ActionAtom *atom)
}
}
-MenuFile::ActionAtom *MenuFile::pushAction(MenuFile::ActionType action, const QString &arg1, const QString &arg2)
+MenuFile::ActionAtom *MenuFile::pushAction(MenuFile::ActionType action, const TQString &arg1, const TQString &arg2)
{
ActionAtom *atom = new ActionAtom;
atom->action = action;
@@ -530,9 +530,9 @@ bool MenuFile::performAllActions()
// Entries that have been removed from the menu are added to .hidden
// so that they don't re-appear in Lost & Found
- QStringList removed = m_removedEntries;
+ TQStringList removed = m_removedEntries;
m_removedEntries.clear();
- for(QStringList::ConstIterator it = removed.begin();
+ for(TQStringList::ConstIterator it = removed.begin();
it != removed.end(); ++it)
{
addEntry("/.hidden/", *it);
diff --git a/kmenuedit/menufile.h b/kmenuedit/menufile.h
index 61ca3a9f..c216d486 100644
--- a/kmenuedit/menufile.h
+++ b/kmenuedit/menufile.h
@@ -19,19 +19,19 @@
#ifndef __menufile_h__
#define __menufile_h__
-#include <qdom.h>
-#include <qstring.h>
+#include <tqdom.h>
+#include <tqstring.h>
class MenuFile
{
public:
- MenuFile(const QString &file);
+ MenuFile(const TQString &file);
~MenuFile();
bool load();
bool save();
void create();
- QString error() { return m_error; } // Returns the last error message
+ TQString error() { return m_error; } // Returns the last error message
enum ActionType {
ADD_ENTRY = 0,
@@ -44,14 +44,14 @@ public:
struct ActionAtom
{
ActionType action;
- QString arg1;
- QString arg2;
+ TQString arg1;
+ TQString arg2;
};
/**
* Create action atom and push it on the stack
*/
- ActionAtom *pushAction(ActionType action, const QString &arg1, const QString &arg2);
+ ActionAtom *pushAction(ActionType action, const TQString &arg1, const TQString &arg2);
/**
* Pop @p atom from the stack.
@@ -76,20 +76,20 @@ public:
*/
bool dirty();
- void addEntry(const QString &menuName, const QString &menuId);
- void removeEntry(const QString &menuName, const QString &menuId);
+ void addEntry(const TQString &menuName, const TQString &menuId);
+ void removeEntry(const TQString &menuName, const TQString &menuId);
- void addMenu(const QString &menuName, const QString &menuFile);
- void moveMenu(const QString &oldMenu, const QString &newMenu);
- void removeMenu(const QString &menuName);
+ void addMenu(const TQString &menuName, const TQString &menuFile);
+ void moveMenu(const TQString &oldMenu, const TQString &newMenu);
+ void removeMenu(const TQString &menuName);
- void setLayout(const QString &menuName, const QStringList &layout);
+ void setLayout(const TQString &menuName, const TQStringList &layout);
/**
* Returns a unique menu-name for a new menu under @p menuName
* inspired by @p newMenu and not part of @p excludeList
*/
- QString uniqueMenuName(const QString &menuName, const QString &newMenu, const QStringList &excludeList);
+ TQString uniqueMenuName(const TQString &menuName, const TQString &newMenu, const TQStringList &excludeList);
protected:
/**
@@ -97,17 +97,17 @@ protected:
* If @p create is true, the menu is created if it doesn't exist yet.
* @return The menu dom-node of @p menuName
*/
- QDomElement findMenu(QDomElement elem, const QString &menuName, bool create);
+ TQDomElement findMenu(TQDomElement elem, const TQString &menuName, bool create);
private:
- QString m_error;
- QString m_fileName;
+ TQString m_error;
+ TQString m_fileName;
- QDomDocument m_doc;
+ TQDomDocument m_doc;
bool m_bDirty;
- QPtrList<ActionAtom> m_actionList;
- QStringList m_removedEntries;
+ TQPtrList<ActionAtom> m_actionList;
+ TQStringList m_removedEntries;
};
diff --git a/kmenuedit/menuinfo.cpp b/kmenuedit/menuinfo.cpp
index 1fa4cb43..ce17b33e 100644
--- a/kmenuedit/menuinfo.cpp
+++ b/kmenuedit/menuinfo.cpp
@@ -20,7 +20,7 @@
#include "menuinfo.h"
#include "menufile.h"
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kdesktopfile.h>
#include <khotkeys.h>
@@ -30,10 +30,10 @@
// MenuFolderInfo
//
-static QStringList *s_allShortcuts = 0;
-static QStringList *s_newShortcuts = 0;
-static QStringList *s_freeShortcuts = 0;
-static QStringList *s_deletedApps = 0;
+static TQStringList *s_allShortcuts = 0;
+static TQStringList *s_newShortcuts = 0;
+static TQStringList *s_freeShortcuts = 0;
+static TQStringList *s_deletedApps = 0;
// Add separator
void MenuFolderInfo::add(MenuSeparatorInfo *info, bool initial)
@@ -76,7 +76,7 @@ bool MenuFolderInfo::takeRecursive(MenuFolderInfo *info)
}
// Recursively update all fullIds
-void MenuFolderInfo::updateFullId(const QString &parentId)
+void MenuFolderInfo::updateFullId(const TQString &parentId)
{
fullId = parentId + id;
@@ -103,12 +103,12 @@ void MenuFolderInfo::take(MenuEntryInfo *entry)
// Return a unique sub-menu caption inspired by @p caption
-QString MenuFolderInfo::uniqueMenuCaption(const QString &caption)
+TQString MenuFolderInfo::uniqueMenuCaption(const TQString &caption)
{
- QRegExp r("(.*)(?=-\\d+)");
- QString cap = (r.search(caption) > -1) ? r.cap(1) : caption;
+ TQRegExp r("(.*)(?=-\\d+)");
+ TQString cap = (r.search(caption) > -1) ? r.cap(1) : caption;
- QString result = caption;
+ TQString result = caption;
for(int n = 1; ++n; )
{
@@ -125,18 +125,18 @@ QString MenuFolderInfo::uniqueMenuCaption(const QString &caption)
if (ok)
return result;
- result = cap + QString("-%1").arg(n);
+ result = cap + TQString("-%1").arg(n);
}
- return QString::null; // Never reached
+ return TQString::null; // Never reached
}
// Return a unique item caption inspired by @p caption
-QString MenuFolderInfo::uniqueItemCaption(const QString &caption, const QString &exclude)
+TQString MenuFolderInfo::uniqueItemCaption(const TQString &caption, const TQString &exclude)
{
- QRegExp r("(.*)(?=-\\d+)");
- QString cap = (r.search(caption) > -1) ? r.cap(1) : caption;
+ TQRegExp r("(.*)(?=-\\d+)");
+ TQString cap = (r.search(caption) > -1) ? r.cap(1) : caption;
- QString result = caption;
+ TQString result = caption;
for(int n = 1; ++n; )
{
@@ -144,7 +144,7 @@ QString MenuFolderInfo::uniqueItemCaption(const QString &caption, const QString
if (result == exclude)
ok = false;
MenuEntryInfo *entryInfo;
- for(QPtrListIterator<MenuEntryInfo> it(entries);
+ for(TQPtrListIterator<MenuEntryInfo> it(entries);
ok && (entryInfo = it.current()); ++it)
{
if (entryInfo->caption == result)
@@ -153,15 +153,15 @@ QString MenuFolderInfo::uniqueItemCaption(const QString &caption, const QString
if (ok)
return result;
- result = cap + QString("-%1").arg(n);
+ result = cap + TQString("-%1").arg(n);
}
- return QString::null; // Never reached
+ return TQString::null; // Never reached
}
// Return a list of existing submenu ids
-QStringList MenuFolderInfo::existingMenuIds()
+TQStringList MenuFolderInfo::existingMenuIds()
{
- QStringList result;
+ TQStringList result;
for(MenuFolderInfo *subFolderInfo = subFolders.first();
subFolderInfo; subFolderInfo = subFolders.next())
{
@@ -180,7 +180,7 @@ void MenuFolderInfo::save(MenuFile *menuFile)
if (s_deletedApps)
{
// Remove hotkeys for applications that have been deleted
- for(QStringList::ConstIterator it = s_deletedApps->begin();
+ for(TQStringList::ConstIterator it = s_deletedApps->begin();
it != s_deletedApps->end(); ++it)
{
KHotKeys::menuEntryDeleted(*it);
@@ -191,7 +191,7 @@ void MenuFolderInfo::save(MenuFile *menuFile)
if (dirty)
{
- QString local = KDesktopFile::locateLocal(directoryFile);
+ TQString local = KDesktopFile::locateLocal(directoryFile);
KConfig *df = 0;
if (directoryFile != local)
@@ -223,7 +223,7 @@ void MenuFolderInfo::save(MenuFile *menuFile)
// Save entries
MenuEntryInfo *entryInfo;
- for(QPtrListIterator<MenuEntryInfo> it(entries);
+ for(TQPtrListIterator<MenuEntryInfo> it(entries);
(entryInfo = it.current()); ++it)
{
if (entryInfo->needInsertion())
@@ -245,7 +245,7 @@ bool MenuFolderInfo::hasDirt()
// Check entries
MenuEntryInfo *entryInfo;
- for(QPtrListIterator<MenuEntryInfo> it(entries);
+ for(TQPtrListIterator<MenuEntryInfo> it(entries);
(entryInfo = it.current()); ++it)
{
if (entryInfo->dirty) return true;
@@ -268,7 +268,7 @@ KService::Ptr MenuFolderInfo::findServiceShortcut(const KShortcut&cut)
// Check entries
MenuEntryInfo *entryInfo;
- for(QPtrListIterator<MenuEntryInfo> it(entries);
+ for(TQPtrListIterator<MenuEntryInfo> it(entries);
(entryInfo = it.current()); ++it)
{
if (entryInfo->shortCut == cut)
@@ -288,7 +288,7 @@ void MenuFolderInfo::setInUse(bool inUse)
// Propagate to entries
MenuEntryInfo *entryInfo;
- for(QPtrListIterator<MenuEntryInfo> it(entries);
+ for(TQPtrListIterator<MenuEntryInfo> it(entries);
(entryInfo = it.current()); ++it)
{
entryInfo->setInUse(inUse);
@@ -320,7 +320,7 @@ void MenuEntryInfo::setDirty()
dirty = true;
- QString local = locateLocal("xdgdata-apps", service->menuId());
+ TQString local = locateLocal("xdgdata-apps", service->menuId());
if (local != service->desktopEntryPath())
{
KDesktopFile *oldDf = desktopFile();
@@ -354,7 +354,7 @@ void MenuEntryInfo::save()
}
}
-void MenuEntryInfo::setCaption(const QString &_caption)
+void MenuEntryInfo::setCaption(const TQString &_caption)
{
if (caption == _caption)
return;
@@ -363,7 +363,7 @@ void MenuEntryInfo::setCaption(const QString &_caption)
desktopFile()->writeEntry("Name", caption);
}
-void MenuEntryInfo::setDescription(const QString &_description)
+void MenuEntryInfo::setDescription(const TQString &_description)
{
if (description == _description)
return;
@@ -372,7 +372,7 @@ void MenuEntryInfo::setDescription(const QString &_description)
desktopFile()->writeEntry("GenericName", description);
}
-void MenuEntryInfo::setIcon(const QString &_icon)
+void MenuEntryInfo::setIcon(const TQString &_icon)
{
if (icon == _icon)
return;
@@ -409,7 +409,7 @@ static void freeShortcut(const KShortcut &shortCut)
{
if (!isEmpty(shortCut))
{
- QString shortcutKey = shortCut.toString();
+ TQString shortcutKey = shortCut.toString();
if (s_newShortcuts)
s_newShortcuts->remove(shortcutKey);
@@ -424,7 +424,7 @@ static void allocateShortcut(const KShortcut &shortCut)
{
if (!isEmpty(shortCut))
{
- QString shortcutKey = shortCut.toString();
+ TQString shortcutKey = shortCut.toString();
if (s_freeShortcuts)
s_freeShortcuts->remove(shortcutKey);
@@ -483,11 +483,11 @@ bool MenuEntryInfo::isShortcutAvailable(const KShortcut &_shortcut)
if (shortCut == _shortcut)
return true;
- QString shortcutKey = _shortcut.toString();
+ TQString shortcutKey = _shortcut.toString();
bool available = true;
if (!s_allShortcuts)
{
- s_allShortcuts = new QStringList(KHotKeys::allShortCuts());
+ s_allShortcuts = new TQStringList(KHotKeys::allShortCuts());
}
available = !s_allShortcuts->contains(shortcutKey);
if (available && s_newShortcuts)
diff --git a/kmenuedit/menuinfo.h b/kmenuedit/menuinfo.h
index 17a17e7f..1d9cbeb8 100644
--- a/kmenuedit/menuinfo.h
+++ b/kmenuedit/menuinfo.h
@@ -20,7 +20,7 @@
#ifndef __menuinfo_h__
#define __menuinfo_h__
-#include <qstring.h>
+#include <tqstring.h>
#include <kshortcut.h>
#include <kservice.h>
@@ -66,40 +66,40 @@ public:
void take(MenuEntryInfo *);
// Return a unique sub-menu caption inspired by @p caption
- QString uniqueMenuCaption(const QString &caption);
+ TQString uniqueMenuCaption(const TQString &caption);
// Return a unique item caption inspired by @p caption but different
// from @p exclude
- QString uniqueItemCaption(const QString &caption, const QString &exclude = QString::null);
+ TQString uniqueItemCaption(const TQString &caption, const TQString &exclude = TQString::null);
// Update full id's for this item and all submenus
- void updateFullId(const QString &parentId);
+ void updateFullId(const TQString &parentId);
// Return a list of existing submenu ids
- QStringList existingMenuIds();
+ TQStringList existingMenuIds();
- void setCaption(const QString &_caption)
+ void setCaption(const TQString &_caption)
{
if (_caption == caption) return;
caption = _caption;
setDirty();
}
- void setIcon(const QString &_icon)
+ void setIcon(const TQString &_icon)
{
if (_icon == icon) return;
icon = _icon;
setDirty();
}
- void setGenericName(const QString &_description)
+ void setGenericName(const TQString &_description)
{
if (_description == genericname) return;
genericname = _description;
setDirty();
}
- void setComment(const QString &_comment)
+ void setComment(const TQString &_comment)
{
if (_comment == comment) return;
comment = _comment;
@@ -125,16 +125,16 @@ public:
void setInUse(bool inUse);
public:
- QString id; // Relative to parent
- QString fullId; // Name in tree
- QString caption; // Visible name
- QString genericname; // Generic description
- QString comment; // Comment
- QString directoryFile; // File describing this folder.
- QString icon; // Icon
- QPtrList<MenuFolderInfo> subFolders; // Sub menus in this folder
- QPtrList<MenuEntryInfo> entries; // Menu entries in this folder
- QPtrList<MenuInfo> initialLayout; // Layout of menu entries according to sycoca
+ TQString id; // Relative to parent
+ TQString fullId; // Name in tree
+ TQString caption; // Visible name
+ TQString genericname; // Generic description
+ TQString comment; // Comment
+ TQString directoryFile; // File describing this folder.
+ TQString icon; // Icon
+ TQPtrList<MenuFolderInfo> subFolders; // Sub menus in this folder
+ TQPtrList<MenuEntryInfo> entries; // Menu entries in this folder
+ TQPtrList<MenuInfo> initialLayout; // Layout of menu entries according to sycoca
bool dirty;
bool hidden;
};
@@ -152,13 +152,13 @@ public:
}
~MenuEntryInfo();
- void setCaption(const QString &_caption);
- void setDescription(const QString &_description);
- void setIcon(const QString &_icon);
+ void setCaption(const TQString &_caption);
+ void setDescription(const TQString &_description);
+ void setIcon(const TQString &_icon);
- QString menuId() const { return service->menuId(); }
+ TQString menuId() const { return service->menuId(); }
- QString file() const { return service->desktopEntryPath(); }
+ TQString file() const { return service->desktopEntryPath(); }
KShortcut shortcut();
void setShortcut(const KShortcut &_shortcut);
@@ -177,9 +177,9 @@ public:
KDesktopFile *desktopFile();
public:
- QString caption;
- QString description;
- QString icon;
+ TQString caption;
+ TQString description;
+ TQString icon;
KService::Ptr service;
KDesktopFile *df;
KShortcut shortCut;
diff --git a/kmenuedit/treeview.cpp b/kmenuedit/treeview.cpp
index 760c052f..693ba568 100644
--- a/kmenuedit/treeview.cpp
+++ b/kmenuedit/treeview.cpp
@@ -21,17 +21,17 @@
#include <unistd.h>
-#include <qcstring.h>
-#include <qcursor.h>
-#include <qdatastream.h>
-#include <qdir.h>
-#include <qdragobject.h>
-#include <qfileinfo.h>
-#include <qheader.h>
-#include <qpainter.h>
-#include <qpopupmenu.h>
-#include <qregexp.h>
-#include <qstringlist.h>
+#include <tqcstring.h>
+#include <tqcursor.h>
+#include <tqdatastream.h>
+#include <tqdir.h>
+#include <tqdragobject.h>
+#include <tqfileinfo.h>
+#include <tqheader.h>
+#include <tqpainter.h>
+#include <tqpopupmenu.h>
+#include <tqregexp.h>
+#include <tqstringlist.h>
#include <kglobal.h>
#include <kstandarddirs.h>
@@ -61,15 +61,15 @@
#define COPY_FILE 'c'
#define COPY_SEPARATOR 'S'
-TreeItem::TreeItem(QListViewItem *parent, QListViewItem *after, const QString& menuId, bool __init)
- :QListViewItem(parent, after), _hidden(false), _init(__init), _layoutDirty(false), _menuId(menuId),
+TreeItem::TreeItem(TQListViewItem *parent, TQListViewItem *after, const TQString& menuId, bool __init)
+ :TQListViewItem(parent, after), _hidden(false), _init(__init), _layoutDirty(false), _menuId(menuId),
m_folderInfo(0), m_entryInfo(0) {}
-TreeItem::TreeItem(QListView *parent, QListViewItem *after, const QString& menuId, bool __init)
- : QListViewItem(parent, after), _hidden(false), _init(__init), _layoutDirty(false), _menuId(menuId),
+TreeItem::TreeItem(TQListView *parent, TQListViewItem *after, const TQString& menuId, bool __init)
+ : TQListViewItem(parent, after), _hidden(false), _init(__init), _layoutDirty(false), _menuId(menuId),
m_folderInfo(0), m_entryInfo(0) {}
-void TreeItem::setName(const QString &name)
+void TreeItem::setName(const TQString &name)
{
_name = name;
update();
@@ -84,7 +84,7 @@ void TreeItem::setHidden(bool b)
void TreeItem::update()
{
- QString s = _name;
+ TQString s = _name;
if (_hidden)
s += i18n(" [Hidden]");
setText(0, s);
@@ -95,7 +95,7 @@ void TreeItem::setOpen(bool o)
if (o)
load();
- QListViewItem::setOpen(o);
+ TQListViewItem::setOpen(o);
}
void TreeItem::load()
@@ -108,9 +108,9 @@ void TreeItem::load()
}
}
-void TreeItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align )
+void TreeItem::paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align )
{
- QListViewItem::paintCell(p, cg, column, width, align);
+ TQListViewItem::paintCell(p, cg, column, width, align);
if (!m_folderInfo && !m_entryInfo)
{
@@ -127,18 +127,18 @@ void TreeItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int
void TreeItem::setup()
{
- QListViewItem::setup();
+ TQListViewItem::setup();
if (!m_folderInfo && !m_entryInfo)
setHeight(8);
}
-static QPixmap appIcon(const QString &iconName)
+static TQPixmap appIcon(const TQString &iconName)
{
- QPixmap normal = KGlobal::iconLoader()->loadIcon(iconName, KIcon::Small, 0, KIcon::DefaultState, 0L, true);
+ TQPixmap normal = KGlobal::iconLoader()->loadIcon(iconName, KIcon::Small, 0, KIcon::DefaultState, 0L, true);
// make sure they are not larger than 20x20
if (normal.width() > 20 || normal.height() > 20)
{
- QImage tmp = normal.convertToImage();
+ TQImage tmp = normal.convertToImage();
tmp = tmp.smoothScale(20, 20);
normal.convertFromImage(tmp);
}
@@ -146,12 +146,12 @@ static QPixmap appIcon(const QString &iconName)
}
-TreeView::TreeView( bool controlCenter, KActionCollection *ac, QWidget *parent, const char *name )
+TreeView::TreeView( bool controlCenter, KActionCollection *ac, TQWidget *parent, const char *name )
: KListView(parent, name), m_ac(ac), m_rmb(0), m_clipboard(0),
m_clipboardFolderInfo(0), m_clipboardEntryInfo(0),
m_controlCenter(controlCenter), m_layoutDirty(false)
{
- setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
+ setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
setAllColumnsShowFocus(true);
setRootIsDecorated(true);
setSorting(-1);
@@ -163,23 +163,23 @@ TreeView::TreeView( bool controlCenter, KActionCollection *ac, QWidget *parent,
addColumn("");
header()->hide();
- connect(this, SIGNAL(dropped(QDropEvent*, QListViewItem*, QListViewItem*)),
- SLOT(slotDropped(QDropEvent*, QListViewItem*, QListViewItem*)));
+ connect(this, TQT_SIGNAL(dropped(TQDropEvent*, TQListViewItem*, TQListViewItem*)),
+ TQT_SLOT(slotDropped(TQDropEvent*, TQListViewItem*, TQListViewItem*)));
- connect(this, SIGNAL(clicked( QListViewItem* )),
- SLOT(itemSelected( QListViewItem* )));
+ connect(this, TQT_SIGNAL(clicked( TQListViewItem* )),
+ TQT_SLOT(itemSelected( TQListViewItem* )));
- connect(this,SIGNAL(selectionChanged ( QListViewItem * )),
- SLOT(itemSelected( QListViewItem* )));
+ connect(this,TQT_SIGNAL(selectionChanged ( TQListViewItem * )),
+ TQT_SLOT(itemSelected( TQListViewItem* )));
- connect(this, SIGNAL(rightButtonPressed(QListViewItem*, const QPoint&, int)),
- SLOT(slotRMBPressed(QListViewItem*, const QPoint&)));
+ connect(this, TQT_SIGNAL(rightButtonPressed(TQListViewItem*, const TQPoint&, int)),
+ TQT_SLOT(slotRMBPressed(TQListViewItem*, const TQPoint&)));
// connect actions
- connect(m_ac->action("newitem"), SIGNAL(activated()), SLOT(newitem()));
- connect(m_ac->action("newsubmenu"), SIGNAL(activated()), SLOT(newsubmenu()));
+ connect(m_ac->action("newitem"), TQT_SIGNAL(activated()), TQT_SLOT(newitem()));
+ connect(m_ac->action("newsubmenu"), TQT_SIGNAL(activated()), TQT_SLOT(newsubmenu()));
if (m_ac->action("newsep"))
- connect(m_ac->action("newsep"), SIGNAL(activated()), SLOT(newsep()));
+ connect(m_ac->action("newsep"), TQT_SIGNAL(activated()), TQT_SLOT(newsep()));
m_menuFile = new MenuFile( locateLocal("xdgconf-menu", "applications-kmenuedit.menu"));
m_rootFolder = new MenuFolderInfo;
@@ -208,28 +208,28 @@ void TreeView::setViewMode(bool showHidden)
delete m_rmb;
// setup rmb menu
- m_rmb = new QPopupMenu(this);
+ m_rmb = new TQPopupMenu(this);
KAction *action;
action = m_ac->action("edit_cut");
if(action) {
action->plug(m_rmb);
action->setEnabled(false);
- connect(action, SIGNAL(activated()), SLOT(cut()));
+ connect(action, TQT_SIGNAL(activated()), TQT_SLOT(cut()));
}
action = m_ac->action("edit_copy");
if(action) {
action->plug(m_rmb);
action->setEnabled(false);
- connect(action, SIGNAL(activated()), SLOT(copy()));
+ connect(action, TQT_SIGNAL(activated()), TQT_SLOT(copy()));
}
action = m_ac->action("edit_paste");
if(action) {
action->plug(m_rmb);
action->setEnabled(false);
- connect(action, SIGNAL(activated()), SLOT(paste()));
+ connect(action, TQT_SIGNAL(activated()), TQT_SLOT(paste()));
}
m_rmb->insertSeparator();
@@ -238,7 +238,7 @@ void TreeView::setViewMode(bool showHidden)
if(action) {
action->plug(m_rmb);
action->setEnabled(false);
- connect(action, SIGNAL(activated()), SLOT(del()));
+ connect(action, TQT_SIGNAL(activated()), TQT_SLOT(del()));
}
m_rmb->insertSeparator();
@@ -255,7 +255,7 @@ void TreeView::setViewMode(bool showHidden)
fill();
}
-void TreeView::readMenuFolderInfo(MenuFolderInfo *folderInfo, KServiceGroup::Ptr folder, const QString &prefix)
+void TreeView::readMenuFolderInfo(MenuFolderInfo *folderInfo, KServiceGroup::Ptr folder, const TQString &prefix)
{
if (!folderInfo)
{
@@ -277,7 +277,7 @@ void TreeView::readMenuFolderInfo(MenuFolderInfo *folderInfo, KServiceGroup::Ptr
folderInfo->hidden = folder->noDisplay();
folderInfo->directoryFile = folder->directoryEntryPath();
folderInfo->icon = folder->icon();
- QString id = folder->relPath();
+ TQString id = folder->relPath();
int i = id.findRev('/', -2);
id = id.mid(i+1);
folderInfo->id = id;
@@ -310,27 +310,27 @@ void TreeView::readMenuFolderInfo(MenuFolderInfo *folderInfo, KServiceGroup::Ptr
void TreeView::fill()
{
- QApplication::setOverrideCursor(Qt::WaitCursor);
+ TQApplication::setOverrideCursor(Qt::WaitCursor);
clear();
fillBranch(m_rootFolder, 0);
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
-QString TreeView::findName(KDesktopFile *df, bool deleted)
+TQString TreeView::findName(KDesktopFile *df, bool deleted)
{
- QString name = df->readName();
+ TQString name = df->readName();
if (deleted)
{
if (name == "empty")
- name = QString::null;
+ name = TQString::null;
if (name.isEmpty())
{
- QString file = df->fileName();
- QString res = df->resource();
+ TQString file = df->fileName();
+ TQString res = df->resource();
bool isLocal = true;
- QStringList files = KGlobal::dirs()->findAllResources(res.latin1(), file);
- for(QStringList::ConstIterator it = files.begin();
+ TQStringList files = KGlobal::dirs()->findAllResources(res.latin1(), file);
+ for(TQStringList::ConstIterator it = files.begin();
it != files.end();
++it)
{
@@ -351,13 +351,13 @@ QString TreeView::findName(KDesktopFile *df, bool deleted)
return name;
}
-TreeItem *TreeView::createTreeItem(TreeItem *parent, QListViewItem *after, MenuFolderInfo *folderInfo, bool _init)
+TreeItem *TreeView::createTreeItem(TreeItem *parent, TQListViewItem *after, MenuFolderInfo *folderInfo, bool _init)
{
TreeItem *item;
if (parent == 0)
- item = new TreeItem(this, after, QString::null, _init);
+ item = new TreeItem(this, after, TQString::null, _init);
else
- item = new TreeItem(parent, after, QString::null, _init);
+ item = new TreeItem(parent, after, TQString::null, _init);
item->setMenuFolderInfo(folderInfo);
item->setName(folderInfo->caption);
@@ -368,7 +368,7 @@ TreeItem *TreeView::createTreeItem(TreeItem *parent, QListViewItem *after, MenuF
return item;
}
-TreeItem *TreeView::createTreeItem(TreeItem *parent, QListViewItem *after, MenuEntryInfo *entryInfo, bool _init)
+TreeItem *TreeView::createTreeItem(TreeItem *parent, TQListViewItem *after, MenuEntryInfo *entryInfo, bool _init)
{
bool hidden = entryInfo->hidden;
@@ -403,21 +403,21 @@ TreeItem *TreeView::createTreeItem(TreeItem *parent, QListViewItem *after, MenuE
return item;
}
-TreeItem *TreeView::createTreeItem(TreeItem *parent, QListViewItem *after, MenuSeparatorInfo *, bool _init)
+TreeItem *TreeView::createTreeItem(TreeItem *parent, TQListViewItem *after, MenuSeparatorInfo *, bool _init)
{
TreeItem* item;
if (parent == 0)
- item = new TreeItem(this, after, QString::null, _init);
+ item = new TreeItem(this, after, TQString::null, _init);
else
- item = new TreeItem(parent, after, QString::null,_init);
+ item = new TreeItem(parent, after, TQString::null,_init);
return item;
}
void TreeView::fillBranch(MenuFolderInfo *folderInfo, TreeItem *parent)
{
- QString relPath = parent ? parent->directory() : QString::null;
- QPtrListIterator<MenuInfo> it( folderInfo->initialLayout );
+ TQString relPath = parent ? parent->directory() : TQString::null;
+ TQPtrListIterator<MenuInfo> it( folderInfo->initialLayout );
TreeItem *after = 0;
for (MenuInfo *info; (info = it.current()); ++it)
{
@@ -443,7 +443,7 @@ void TreeView::fillBranch(MenuFolderInfo *folderInfo, TreeItem *parent)
}
}
-void TreeView::closeAllItems(QListViewItem *item)
+void TreeView::closeAllItems(TQListViewItem *item)
{
if (!item) return;
while(item)
@@ -454,7 +454,7 @@ void TreeView::closeAllItems(QListViewItem *item)
}
}
-void TreeView::selectMenu(const QString &menu)
+void TreeView::selectMenu(const TQString &menu)
{
closeAllItems(firstChild());
@@ -465,7 +465,7 @@ void TreeView::selectMenu(const QString &menu)
return; // Root menu
}
- QString restMenu = menu.mid(1);
+ TQString restMenu = menu.mid(1);
if (!restMenu.endsWith("/"))
restMenu += "/";
@@ -473,7 +473,7 @@ void TreeView::selectMenu(const QString &menu)
do
{
int i = restMenu.find("/");
- QString subMenu = restMenu.left(i+1);
+ TQString subMenu = restMenu.left(i+1);
restMenu = restMenu.mid(i+1);
item = (TreeItem*)(item ? item->firstChild() : firstChild());
@@ -497,7 +497,7 @@ void TreeView::selectMenu(const QString &menu)
}
}
-void TreeView::selectMenuEntry(const QString &menuEntry)
+void TreeView::selectMenuEntry(const TQString &menuEntry)
{
TreeItem *item = (TreeItem *) selectedItem();
if (!item)
@@ -522,7 +522,7 @@ void TreeView::selectMenuEntry(const QString &menuEntry)
}
}
-void TreeView::itemSelected(QListViewItem *item)
+void TreeView::itemSelected(TQListViewItem *item)
{
TreeItem *_item = (TreeItem*)item;
bool selected = false;
@@ -587,29 +587,29 @@ void TreeView::currentChanged(MenuEntryInfo *entryInfo)
item->setPixmap(0, appIcon(entryInfo->icon));
}
-QStringList TreeView::fileList(const QString& rPath)
+TQStringList TreeView::fileList(const TQString& rPath)
{
- QString relativePath = rPath;
+ TQString relativePath = rPath;
// truncate "/.directory"
int pos = relativePath.findRev("/.directory");
if (pos > 0) relativePath.truncate(pos);
- QStringList filelist;
+ TQStringList filelist;
// loop through all resource dirs and build a file list
- QStringList resdirlist = KGlobal::dirs()->resourceDirs("apps");
- for (QStringList::ConstIterator it = resdirlist.begin(); it != resdirlist.end(); ++it)
+ TQStringList resdirlist = KGlobal::dirs()->resourceDirs("apps");
+ for (TQStringList::ConstIterator it = resdirlist.begin(); it != resdirlist.end(); ++it)
{
- QDir dir((*it) + "/" + relativePath);
+ TQDir dir((*it) + "/" + relativePath);
if(!dir.exists()) continue;
- dir.setFilter(QDir::Files);
+ dir.setFilter(TQDir::Files);
dir.setNameFilter("*.desktop;*.kdelnk");
// build a list of files
- QStringList files = dir.entryList();
- for (QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
+ TQStringList files = dir.entryList();
+ for (TQStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
// does not work?!
//if (filelist.contains(*it)) continue;
@@ -626,27 +626,27 @@ QStringList TreeView::fileList(const QString& rPath)
return filelist;
}
-QStringList TreeView::dirList(const QString& rPath)
+TQStringList TreeView::dirList(const TQString& rPath)
{
- QString relativePath = rPath;
+ TQString relativePath = rPath;
// truncate "/.directory"
int pos = relativePath.findRev("/.directory");
if (pos > 0) relativePath.truncate(pos);
- QStringList dirlist;
+ TQStringList dirlist;
// loop through all resource dirs and build a subdir list
- QStringList resdirlist = KGlobal::dirs()->resourceDirs("apps");
- for (QStringList::ConstIterator it = resdirlist.begin(); it != resdirlist.end(); ++it)
+ TQStringList resdirlist = KGlobal::dirs()->resourceDirs("apps");
+ for (TQStringList::ConstIterator it = resdirlist.begin(); it != resdirlist.end(); ++it)
{
- QDir dir((*it) + "/" + relativePath);
+ TQDir dir((*it) + "/" + relativePath);
if(!dir.exists()) continue;
- dir.setFilter(QDir::Dirs);
+ dir.setFilter(TQDir::Dirs);
// build a list of subdirs
- QStringList subdirs = dir.entryList();
- for (QStringList::ConstIterator it = subdirs.begin(); it != subdirs.end(); ++it) {
+ TQStringList subdirs = dir.entryList();
+ for (TQStringList::ConstIterator it = subdirs.begin(); it != subdirs.end(); ++it) {
if ((*it) == "." || (*it) == "..") continue;
// does not work?!
// if (dirlist.contains(*it)) continue;
@@ -664,7 +664,7 @@ QStringList TreeView::dirList(const QString& rPath)
return dirlist;
}
-bool TreeView::acceptDrag(QDropEvent* e) const
+bool TreeView::acceptDrag(TQDropEvent* e) const
{
if (e->provides("application/x-kmenuedit-internal") &&
(e->source() == const_cast<TreeView *>(this)))
@@ -677,43 +677,43 @@ bool TreeView::acceptDrag(QDropEvent* e) const
}
-static QString createDesktopFile(const QString &file, QString *menuId, QStringList *excludeList)
+static TQString createDesktopFile(const TQString &file, TQString *menuId, TQStringList *excludeList)
{
- QString base = file.mid(file.findRev('/')+1);
+ TQString base = file.mid(file.findRev('/')+1);
base = base.left(base.findRev('.'));
- QRegExp r("(.*)(?=-\\d+)");
+ TQRegExp r("(.*)(?=-\\d+)");
base = (r.search(base) > -1) ? r.cap(1) : base;
- QString result = KService::newServicePath(true, base, menuId, excludeList);
+ TQString result = KService::newServicePath(true, base, menuId, excludeList);
excludeList->append(*menuId);
// Todo for Undo-support: Undo menuId allocation:
return result;
}
-static KDesktopFile *copyDesktopFile(MenuEntryInfo *entryInfo, QString *menuId, QStringList *excludeList)
+static KDesktopFile *copyDesktopFile(MenuEntryInfo *entryInfo, TQString *menuId, TQStringList *excludeList)
{
- QString result = createDesktopFile(entryInfo->file(), menuId, excludeList);
+ TQString result = createDesktopFile(entryInfo->file(), menuId, excludeList);
KDesktopFile *df = entryInfo->desktopFile()->copyTo(result);
df->deleteEntry("Categories"); // Don't set any categories!
return df;
}
-static QString createDirectoryFile(const QString &file, QStringList *excludeList)
+static TQString createDirectoryFile(const TQString &file, TQStringList *excludeList)
{
- QString base = file.mid(file.findRev('/')+1);
+ TQString base = file.mid(file.findRev('/')+1);
base = base.left(base.findRev('.'));
- QString result;
+ TQString result;
int i = 1;
while(true)
{
if (i == 1)
result = base + ".directory";
else
- result = base + QString("-%1.directory").arg(i);
+ result = base + TQString("-%1.directory").arg(i);
if (!excludeList->contains(result))
{
@@ -728,13 +728,13 @@ static QString createDirectoryFile(const QString &file, QStringList *excludeList
}
-void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem*after)
+void TreeView::slotDropped (TQDropEvent * e, TQListViewItem *parent, TQListViewItem*after)
{
if(!e) return;
// get destination folder
TreeItem *parentItem = static_cast<TreeItem*>(parent);
- QString folder = parentItem ? parentItem->directory() : QString::null;
+ TQString folder = parentItem ? parentItem->directory() : TQString::null;
MenuFolderInfo *parentFolderInfo = parentItem ? parentItem->folderInfo() : m_rootFolder;
if (e->source() != this)
@@ -743,12 +743,12 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
KURL::List urls;
if (!KURLDrag::decode(e, urls) || (urls.count() != 1) || !urls[0].isLocalFile())
return;
- QString path = urls[0].path();
+ TQString path = urls[0].path();
if (!path.endsWith(".desktop"))
return;
- QString menuId;
- QString result = createDesktopFile(path, &menuId, &m_newMenuIds);
+ TQString menuId;
+ TQString result = createDesktopFile(path, &menuId, &m_newMenuIds);
KDesktopFile orig_df(path);
KDesktopFile *df = orig_df.copyTo(result);
df->deleteEntry("Categories"); // Don't set any categories!
@@ -758,8 +758,8 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
MenuEntryInfo *entryInfo = new MenuEntryInfo(s, df);
- QString oldCaption = entryInfo->caption;
- QString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption, oldCaption);
+ TQString oldCaption = entryInfo->caption;
+ TQString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption, oldCaption);
entryInfo->setCaption(newCaption);
// Add file to menu
@@ -792,7 +792,7 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
if (command == MOVE_FOLDER)
{
MenuFolderInfo *folderInfo = m_dragInfo;
- if (e->action() == QDropEvent::Copy)
+ if (e->action() == TQDropEvent::Copy)
{
// Ugh.. this is hard :)
// * Create new .directory file
@@ -817,9 +817,9 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
oldParentFolderInfo->take(folderInfo);
// Move menu
- QString oldFolder = folderInfo->fullId;
- QString folderName = folderInfo->id;
- QString newFolder = m_menuFile->uniqueMenuName(folder, folderName, parentFolderInfo->existingMenuIds());
+ TQString oldFolder = folderInfo->fullId;
+ TQString folderName = folderInfo->id;
+ TQString newFolder = m_menuFile->uniqueMenuName(folder, folderName, parentFolderInfo->existingMenuIds());
folderInfo->id = newFolder;
// Add file to menu
@@ -827,7 +827,7 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
m_menuFile->pushAction(MenuFile::MOVE_MENU, oldFolder, folder + newFolder);
// Make sure caption is unique
- QString newCaption = parentFolderInfo->uniqueMenuCaption(folderInfo->caption);
+ TQString newCaption = parentFolderInfo->uniqueMenuCaption(folderInfo->caption);
if (newCaption != folderInfo->caption)
{
folderInfo->setCaption(newCaption);
@@ -863,9 +863,9 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
else if (command == MOVE_FILE)
{
MenuEntryInfo *entryInfo = m_dragItem->entryInfo();
- QString menuId = entryInfo->menuId();
+ TQString menuId = entryInfo->menuId();
- if (e->action() == QDropEvent::Copy)
+ if (e->action() == TQDropEvent::Copy)
{
// Need to copy file and then add it
@@ -877,15 +877,15 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
entryInfo = new MenuEntryInfo(s, df);
- QString oldCaption = entryInfo->caption;
- QString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption, oldCaption);
+ TQString oldCaption = entryInfo->caption;
+ TQString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption, oldCaption);
entryInfo->setCaption(newCaption);
}
else
{
del(m_dragItem, false);
- QString oldCaption = entryInfo->caption;
- QString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption);
+ TQString oldCaption = entryInfo->caption;
+ TQString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption);
entryInfo->setCaption(newCaption);
entryInfo->setInUse(true);
}
@@ -907,7 +907,7 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
}
else if (command == COPY_SEPARATOR)
{
- if (e->action() != QDropEvent::Copy)
+ if (e->action() != TQDropEvent::Copy)
del(m_dragItem, false);
TreeItem *newItem = createTreeItem(parentItem, after, m_separator, true);
@@ -926,7 +926,7 @@ void TreeView::slotDropped (QDropEvent * e, QListViewItem *parent, QListViewItem
void TreeView::startDrag()
{
- QDragObject *drag = dragObject();
+ TQDragObject *drag = dragObject();
if (!drag)
return;
@@ -934,9 +934,9 @@ void TreeView::startDrag()
drag->dragMove();
}
-QDragObject *TreeView::dragObject()
+TQDragObject *TreeView::dragObject()
{
- m_dragPath = QString::null;
+ m_dragPath = TQString::null;
TreeItem *item = (TreeItem*)selectedItem();
if(item == 0) return 0;
@@ -953,7 +953,7 @@ QDragObject *TreeView::dragObject()
m_drag = MOVE_FILE;
m_dragInfo = 0;
m_dragItem = item;
- QString menuId = item->menuId();
+ TQString menuId = item->menuId();
m_dragPath = item->entryInfo()->service->desktopEntryPath();
if (!m_dragPath.isEmpty())
m_dragPath = locate("apps", m_dragPath);
@@ -971,13 +971,13 @@ QDragObject *TreeView::dragObject()
m_dragItem = item;
}
- drag->addDragObject( new QStoredDrag("application/x-kmenuedit-internal", 0));
+ drag->addDragObject( new TQStoredDrag("application/x-kmenuedit-internal", 0));
if ( item->pixmap(0) )
drag->setPixmap(*item->pixmap(0));
return drag;
}
-void TreeView::slotRMBPressed(QListViewItem*, const QPoint& p)
+void TreeView::slotRMBPressed(TQListViewItem*, const TQPoint& p)
{
TreeItem *item = (TreeItem*)selectedItem();
if(item == 0) return;
@@ -991,23 +991,23 @@ void TreeView::newsubmenu()
TreeItem *item = (TreeItem*)selectedItem();
bool ok;
- QString caption = KInputDialog::getText( i18n( "New Submenu" ),
- i18n( "Submenu name:" ), QString::null, &ok, this );
+ TQString caption = KInputDialog::getText( i18n( "New Submenu" ),
+ i18n( "Submenu name:" ), TQString::null, &ok, this );
if (!ok) return;
- QString file = caption;
+ TQString file = caption;
file.replace('/', '-');
file = createDirectoryFile(file, &m_newDirectoryList); // Create
// get destination folder
- QString folder;
+ TQString folder;
if(!item)
{
parentItem = 0;
- folder = QString::null;
+ folder = TQString::null;
}
else if(item->isDirectory())
{
@@ -1018,7 +1018,7 @@ void TreeView::newsubmenu()
else
{
parentItem = static_cast<TreeItem*>(item->parent());
- folder = parentItem ? parentItem->directory() : QString::null;
+ folder = parentItem ? parentItem->directory() : TQString::null;
}
MenuFolderInfo *parentFolderInfo = parentItem ? parentItem->folderInfo() : m_rootFolder;
@@ -1062,13 +1062,13 @@ void TreeView::newitem()
TreeItem *item = (TreeItem*)selectedItem();
bool ok;
- QString caption = KInputDialog::getText( i18n( "New Item" ),
- i18n( "Item name:" ), QString::null, &ok, this );
+ TQString caption = KInputDialog::getText( i18n( "New Item" ),
+ i18n( "Item name:" ), TQString::null, &ok, this );
if (!ok) return;
- QString menuId;
- QString file = caption;
+ TQString menuId;
+ TQString file = caption;
file.replace('/', '-');
file = createDesktopFile(file, &menuId, &m_newMenuIds); // Create
@@ -1078,12 +1078,12 @@ void TreeView::newitem()
df->writeEntry("Type", "Application");
// get destination folder
- QString folder;
+ TQString folder;
if(!item)
{
parentItem = 0;
- folder = QString::null;
+ folder = TQString::null;
}
else if(item->isDirectory())
{
@@ -1094,7 +1094,7 @@ void TreeView::newitem()
else
{
parentItem = static_cast<TreeItem*>(item->parent());
- folder = parentItem ? parentItem->directory() : QString::null;
+ folder = parentItem ? parentItem->directory() : TQString::null;
}
MenuFolderInfo *parentFolderInfo = parentItem ? parentItem->folderInfo() : m_rootFolder;
@@ -1189,7 +1189,7 @@ void TreeView::copy( bool cutting )
// is item a folder or a file?
if(item->isDirectory())
{
- QString folder = item->directory();
+ TQString folder = item->directory();
if (cutting)
{
// Place in clipboard
@@ -1246,7 +1246,7 @@ void TreeView::paste()
if (!m_clipboard) return;
// get destination folder
- QString folder;
+ TQString folder;
if(item->isDirectory())
{
@@ -1257,7 +1257,7 @@ void TreeView::paste()
else
{
parentItem = static_cast<TreeItem*>(item->parent());
- folder = parentItem ? parentItem->directory() : QString::null;
+ folder = parentItem ? parentItem->directory() : TQString::null;
}
MenuFolderInfo *parentFolderInfo = parentItem ? parentItem->folderInfo() : m_rootFolder;
@@ -1274,9 +1274,9 @@ void TreeView::paste()
else if (command == MOVE_FOLDER)
{
// Move menu
- QString oldFolder = folderInfo->fullId;
- QString folderName = folderInfo->id;
- QString newFolder = m_menuFile->uniqueMenuName(folder, folderName, parentFolderInfo->existingMenuIds());
+ TQString oldFolder = folderInfo->fullId;
+ TQString folderName = folderInfo->id;
+ TQString newFolder = m_menuFile->uniqueMenuName(folder, folderName, parentFolderInfo->existingMenuIds());
folderInfo->id = newFolder;
// Add file to menu
@@ -1284,7 +1284,7 @@ void TreeView::paste()
m_menuFile->pushAction(MenuFile::MOVE_MENU, oldFolder, folder + newFolder);
// Make sure caption is unique
- QString newCaption = parentFolderInfo->uniqueMenuCaption(folderInfo->caption);
+ TQString newCaption = parentFolderInfo->uniqueMenuCaption(folderInfo->caption);
if (newCaption != folderInfo->caption)
{
folderInfo->setCaption(newCaption);
@@ -1309,7 +1309,7 @@ void TreeView::paste()
else if ((command == COPY_FILE) || (command == MOVE_FILE))
{
MenuEntryInfo *entryInfo = m_clipboardEntryInfo;
- QString menuId;
+ TQString menuId;
if (command == COPY_FILE)
{
@@ -1320,8 +1320,8 @@ void TreeView::paste()
s->setMenuId(menuId);
entryInfo = new MenuEntryInfo(s, df);
- QString oldCaption = entryInfo->caption;
- QString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption, oldCaption);
+ TQString oldCaption = entryInfo->caption;
+ TQString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption, oldCaption);
entryInfo->setCaption(newCaption);
}
else if (command == MOVE_FILE)
@@ -1329,8 +1329,8 @@ void TreeView::paste()
menuId = entryInfo->menuId();
m_clipboard = COPY_FILE; // Next one copies.
- QString oldCaption = entryInfo->caption;
- QString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption);
+ TQString oldCaption = entryInfo->caption;
+ TQString newCaption = parentFolderInfo->uniqueItemCaption(oldCaption);
entryInfo->setCaption(newCaption);
entryInfo->setInUse(true);
}
@@ -1412,7 +1412,7 @@ void TreeView::del(TreeItem *item, bool deleteInfo)
// Remove from menu
// m_menuFile->removeMenu(item->directory());
- m_menuFile->pushAction(MenuFile::REMOVE_MENU, item->directory(), QString::null);
+ m_menuFile->pushAction(MenuFile::REMOVE_MENU, item->directory(), TQString::null);
// Remove tree item
delete item;
@@ -1420,7 +1420,7 @@ void TreeView::del(TreeItem *item, bool deleteInfo)
else if (item->isEntry())
{
MenuEntryInfo *entryInfo = item->entryInfo();
- QString menuId = entryInfo->menuId();
+ TQString menuId = entryInfo->menuId();
// Remove MenuFolderInfo
MenuFolderInfo *parentFolderInfo = parentItem ? parentItem->folderInfo() : m_rootFolder;
@@ -1439,7 +1439,7 @@ void TreeView::del(TreeItem *item, bool deleteInfo)
}
// Remove from menu
- QString folder = parentItem ? parentItem->directory() : QString::null;
+ TQString folder = parentItem ? parentItem->directory() : TQString::null;
// m_menuFile->removeEntry(folder, menuId);
m_menuFile->pushAction(MenuFile::REMOVE_ENTRY, folder, menuId);
@@ -1466,11 +1466,11 @@ void TreeView::cleanupClipboard() {
m_clipboard = 0;
}
-static QStringList extractLayout(TreeItem *item)
+static TQStringList extractLayout(TreeItem *item)
{
bool firstFolder = true;
bool firstEntry = true;
- QStringList layout;
+ TQStringList layout;
for(;item; item = static_cast<TreeItem*>(item->nextSibling()))
{
if (item->isDirectory())
@@ -1499,9 +1499,9 @@ static QStringList extractLayout(TreeItem *item)
return layout;
}
-QStringList TreeItem::layout()
+TQStringList TreeItem::layout()
{
- QStringList layout = extractLayout(static_cast<TreeItem*>(firstChild()));
+ TQStringList layout = extractLayout(static_cast<TreeItem*>(firstChild()));
_layoutDirty = false;
return layout;
}
@@ -1510,13 +1510,13 @@ void TreeView::saveLayout()
{
if (m_layoutDirty)
{
- QStringList layout = extractLayout(static_cast<TreeItem*>(firstChild()));
+ TQStringList layout = extractLayout(static_cast<TreeItem*>(firstChild()));
m_menuFile->setLayout(m_rootFolder->fullId, layout);
m_layoutDirty = false;
}
- QPtrList<QListViewItem> lst;
- QListViewItemIterator it( this );
+ TQPtrList<TQListViewItem> lst;
+ TQListViewItemIterator it( this );
while ( it.current() ) {
TreeItem *item = static_cast<TreeItem*>(it.current());
if ( item->isLayoutDirty() )
@@ -1559,8 +1559,8 @@ void TreeView::setLayoutDirty(TreeItem *parentItem)
bool TreeView::isLayoutDirty()
{
- QPtrList<QListViewItem> lst;
- QListViewItemIterator it( this );
+ TQPtrList<TQListViewItem> lst;
+ TQListViewItemIterator it( this );
while ( it.current() ) {
if ( static_cast<TreeItem*>(it.current())->isLayoutDirty() )
return true;
diff --git a/kmenuedit/treeview.h b/kmenuedit/treeview.h
index 13d415c1..63099f44 100644
--- a/kmenuedit/treeview.h
+++ b/kmenuedit/treeview.h
@@ -22,7 +22,7 @@
#ifndef __treeview_h__
#define __treeview_h__
-#include <qstring.h>
+#include <tqstring.h>
#include <klistview.h>
#include <kservice.h>
#include <kservicegroup.h>
@@ -39,13 +39,13 @@ class KShortcut;
class TreeItem : public QListViewItem
{
public:
- TreeItem(QListViewItem *parent, QListViewItem *after, const QString &menuIdn, bool __init = false);
- TreeItem(QListView *parent, QListViewItem* after, const QString &menuId, bool __init = false);
+ TreeItem(TQListViewItem *parent, TQListViewItem *after, const TQString &menuIdn, bool __init = false);
+ TreeItem(TQListView *parent, TQListViewItem* after, const TQString &menuId, bool __init = false);
- QString menuId() const { return _menuId; }
+ TQString menuId() const { return _menuId; }
- QString directory() const { return _directoryPath; }
- void setDirectoryPath(const QString& path) { _directoryPath = path; }
+ TQString directory() const { return _directoryPath; }
+ void setDirectoryPath(const TQString& path) { _directoryPath = path; }
MenuFolderInfo *folderInfo() { return m_folderInfo; }
void setMenuFolderInfo(MenuFolderInfo *folderInfo) { m_folderInfo = folderInfo; }
@@ -53,8 +53,8 @@ public:
MenuEntryInfo *entryInfo() { return m_entryInfo; }
void setMenuEntryInfo(MenuEntryInfo *entryInfo) { m_entryInfo = entryInfo; }
- QString name() const { return _name; }
- void setName(const QString &name);
+ TQString name() const { return _name; }
+ void setName(const TQString &name);
bool isDirectory() const { return m_folderInfo; }
bool isEntry() const { return m_entryInfo; }
@@ -64,12 +64,12 @@ public:
bool isLayoutDirty() { return _layoutDirty; }
void setLayoutDirty() { _layoutDirty = true; }
- QStringList layout();
+ TQStringList layout();
virtual void setOpen(bool o);
void load();
- virtual void paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align);
+ virtual void paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align);
virtual void setup();
private:
@@ -78,9 +78,9 @@ private:
bool _hidden : 1;
bool _init : 1;
bool _layoutDirty : 1;
- QString _menuId;
- QString _name;
- QString _directoryPath;
+ TQString _menuId;
+ TQString _name;
+ TQString _directoryPath;
MenuFolderInfo *m_folderInfo;
MenuEntryInfo *m_entryInfo;
};
@@ -90,17 +90,17 @@ class TreeView : public KListView
friend class TreeItem;
Q_OBJECT
public:
- TreeView(bool controlCenter, KActionCollection *ac, QWidget *parent=0, const char *name=0);
+ TreeView(bool controlCenter, KActionCollection *ac, TQWidget *parent=0, const char *name=0);
~TreeView();
- void readMenuFolderInfo(MenuFolderInfo *folderInfo=0, KServiceGroup::Ptr folder=0, const QString &prefix=QString::null);
+ void readMenuFolderInfo(MenuFolderInfo *folderInfo=0, KServiceGroup::Ptr folder=0, const TQString &prefix=TQString::null);
void setViewMode(bool showHidden);
bool save();
bool dirty();
- void selectMenu(const QString &menu);
- void selectMenuEntry(const QString &menuEntry);
+ void selectMenu(const TQString &menu);
+ void selectMenuEntry(const TQString &menuEntry);
public slots:
void currentChanged(MenuFolderInfo *folderInfo);
@@ -112,9 +112,9 @@ signals:
void entrySelected(MenuEntryInfo *entryInfo);
void disableAction();
protected slots:
- void itemSelected(QListViewItem *);
- void slotDropped(QDropEvent *, QListViewItem *, QListViewItem *);
- void slotRMBPressed(QListViewItem*, const QPoint&);
+ void itemSelected(TQListViewItem *);
+ void slotDropped(TQDropEvent *, TQListViewItem *, TQListViewItem *);
+ void slotRMBPressed(TQListViewItem*, const TQPoint&);
void newsubmenu();
void newitem();
@@ -126,16 +126,16 @@ protected slots:
void del();
protected:
- TreeItem *createTreeItem(TreeItem *parent, QListViewItem *after, MenuFolderInfo *folderInfo, bool _init = false);
- TreeItem *createTreeItem(TreeItem *parent, QListViewItem *after, MenuEntryInfo *entryInfo, bool _init = false);
- TreeItem *createTreeItem(TreeItem *parent, QListViewItem *after, MenuSeparatorInfo *sepInfo, bool _init = false);
+ TreeItem *createTreeItem(TreeItem *parent, TQListViewItem *after, MenuFolderInfo *folderInfo, bool _init = false);
+ TreeItem *createTreeItem(TreeItem *parent, TQListViewItem *after, MenuEntryInfo *entryInfo, bool _init = false);
+ TreeItem *createTreeItem(TreeItem *parent, TQListViewItem *after, MenuSeparatorInfo *sepInfo, bool _init = false);
void del(TreeItem *, bool deleteInfo);
void fill();
void fillBranch(MenuFolderInfo *folderInfo, TreeItem *parent);
- QString findName(KDesktopFile *df, bool deleted);
+ TQString findName(KDesktopFile *df, bool deleted);
- void closeAllItems(QListViewItem *item);
+ void closeAllItems(TQListViewItem *item);
// moving = src will be removed later
void copy( bool moving );
@@ -146,30 +146,30 @@ protected:
void setLayoutDirty(TreeItem *);
void saveLayout();
- QStringList fileList(const QString& relativePath);
- QStringList dirList(const QString& relativePath);
+ TQStringList fileList(const TQString& relativePath);
+ TQStringList dirList(const TQString& relativePath);
- virtual bool acceptDrag(QDropEvent* event) const;
- virtual QDragObject *dragObject();
+ virtual bool acceptDrag(TQDropEvent* event) const;
+ virtual TQDragObject *dragObject();
virtual void startDrag();
private:
KActionCollection *m_ac;
- QPopupMenu *m_rmb;
+ TQPopupMenu *m_rmb;
int m_clipboard;
MenuFolderInfo *m_clipboardFolderInfo;
MenuEntryInfo *m_clipboardEntryInfo;
int m_drag;
MenuFolderInfo *m_dragInfo;
TreeItem *m_dragItem;
- QString m_dragPath;
+ TQString m_dragPath;
bool m_showHidden;
bool m_controlCenter;
MenuFile *m_menuFile;
MenuFolderInfo *m_rootFolder;
MenuSeparatorInfo *m_separator;
- QStringList m_newMenuIds;
- QStringList m_newDirectoryList;
+ TQStringList m_newMenuIds;
+ TQStringList m_newDirectoryList;
bool m_detailedMenuEntries;
bool m_detailedEntriesNamesFirst;
bool m_layoutDirty;