diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /buildtools/autotools/addapplicationdlg.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'buildtools/autotools/addapplicationdlg.cpp')
-rw-r--r-- | buildtools/autotools/addapplicationdlg.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/buildtools/autotools/addapplicationdlg.cpp b/buildtools/autotools/addapplicationdlg.cpp index 04e132dd..f0cd3693 100644 --- a/buildtools/autotools/addapplicationdlg.cpp +++ b/buildtools/autotools/addapplicationdlg.cpp @@ -11,13 +11,13 @@ #include "addapplicationdlg.h" -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qfile.h> -#include <qheader.h> -#include <qlistview.h> -#include <qtextstream.h> -#include <qapplication.h> +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqfile.h> +#include <tqheader.h> +#include <tqlistview.h> +#include <tqtextstream.h> +#include <tqapplication.h> #include <klineedit.h> #include <kdebug.h> #include <kicondialog.h> @@ -33,7 +33,7 @@ AddApplicationDialog::AddApplicationDialog(AutoProjectWidget *widget, SubprojectItem *spitem, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : AddApplicationDialogBase(parent, name, true) { filename_edit->setText(".desktop"); @@ -41,27 +41,27 @@ AddApplicationDialog::AddApplicationDialog(AutoProjectWidget *widget, Subproject filename_edit->setFocus(); chosentypes_listview->header()->hide(); availtypes_listview->header()->hide(); - QString addApplication = add_button->text(); - QString removeApplication = remove_button->text(); + TQString addApplication = add_button->text(); + TQString removeApplication = remove_button->text(); - add_button->setText( QApplication::reverseLayout() ? removeApplication : addApplication ); - remove_button->setText( QApplication::reverseLayout() ? addApplication : removeApplication ); + add_button->setText( TQApplication::reverseLayout() ? removeApplication : addApplication ); + remove_button->setText( TQApplication::reverseLayout() ? addApplication : removeApplication ); m_widget = widget; subProject = spitem; // Fill the combo box with program names in the directory - QPtrListIterator<TargetItem> tit(spitem->targets); + TQPtrListIterator<TargetItem> tit(spitem->targets); for (; tit.current(); ++tit) { if ((*tit)->primary == "PROGRAMS") - executable_combo->insertItem(QString((*tit)->name)); + executable_combo->insertItem(TQString((*tit)->name)); } // Fill the list of available mime types KMimeType::List l = KMimeType::allMimeTypes(); KMimeType::List::Iterator it; for (it = l.begin(); it != l.end(); ++it) - new QListViewItem(availtypes_listview, (*it)->name()); + new TQListViewItem(availtypes_listview, (*it)->name()); setIcon ( SmallIcon ( "window_new" ) ); } @@ -74,7 +74,7 @@ AddApplicationDialog::~AddApplicationDialog() void AddApplicationDialog::iconClicked() { KIconLoader *loader = AutoProjectFactory::instance()->iconLoader(); - QString name = KIconDialog::getIcon(KIcon::Desktop); + TQString name = KIconDialog::getIcon(KIcon::Desktop); if (!name.isNull()) { iconName = name; icon_button->setPixmap(loader->loadIcon(name, KIcon::Desktop)); @@ -84,17 +84,17 @@ void AddApplicationDialog::iconClicked() void AddApplicationDialog::addTypeClicked() { - QListViewItem *selitem = availtypes_listview->selectedItem(); + TQListViewItem *selitem = availtypes_listview->selectedItem(); if (!selitem) return; - QListViewItem *olditem = chosentypes_listview->firstChild(); + TQListViewItem *olditem = chosentypes_listview->firstChild(); while (olditem) { if (selitem->text(0) == olditem->text(0)) return; olditem = olditem->nextSibling(); } - new QListViewItem(chosentypes_listview, selitem->text(0)); + new TQListViewItem(chosentypes_listview, selitem->text(0)); } @@ -107,36 +107,36 @@ void AddApplicationDialog::removeTypeClicked() void AddApplicationDialog::accept() { // Create list of mime types - QStringList mimeTypes; - QListViewItem *item = chosentypes_listview->firstChild(); + TQStringList mimeTypes; + TQListViewItem *item = chosentypes_listview->firstChild(); while (item) { mimeTypes.append(item->text(0)); item = item->nextSibling(); } // Some plausibility tests - QString fileName = filename_edit->text(); + TQString fileName = filename_edit->text(); if (fileName.isEmpty() || fileName == ".desktop") { KMessageBox::sorry(this, i18n("You have to enter a file name.")); filename_edit->setFocus(); return; } - QString executable = executable_combo->currentText(); + TQString executable = executable_combo->currentText(); if (executable.isEmpty()) { KMessageBox::sorry(this, i18n("You have to enter the file name of an executable program.")); executable_combo->setFocus(); return; } - QString name = name_edit->text(); + TQString name = name_edit->text(); if (name.isEmpty()) { KMessageBox::sorry(this, i18n("You have to enter an application name.")); name_edit->setFocus(); return; } - QFile f(subProject->path + "/" + fileName); + TQFile f(subProject->path + "/" + fileName); if (f.exists()) { KMessageBox::sorry(this, i18n("A file with this name exists already.")); filename_edit->setFocus(); @@ -147,7 +147,7 @@ void AddApplicationDialog::accept() return; } - QTextStream stream(&f); + TQTextStream stream(&f); stream << "[Desktop Entry]" << endl; stream << "Type=Application" << endl; stream << "Name=" << name << endl; @@ -161,15 +161,15 @@ void AddApplicationDialog::accept() // Find a prefix that points to the applnk directory. // If there is none, use appslnksection - QString section = section_combo->currentText(); - QString appsdir = "$(kde_appsdir)/" + section; - QMap<QString,QString>::ConstIterator it; + TQString section = section_combo->currentText(); + TQString appsdir = "$(kde_appsdir)/" + section; + TQMap<TQString,TQString>::ConstIterator it; for (it = subProject->prefixes.begin(); it != subProject->prefixes.end(); ++it) if (it.data() == appsdir) break; - QMap<QString, QString> replaceMap; - QString prefix; + TQMap<TQString, TQString> replaceMap; + TQString prefix; if (it == subProject->prefixes.end()) { prefix = "applnk" + section; replaceMap.insert(prefix + "dir", appsdir); @@ -177,7 +177,7 @@ void AddApplicationDialog::accept() } else { prefix = it.key(); } - QString varname = prefix + "_DATA"; + TQString varname = prefix + "_DATA"; // Look if a list view item for this prefix exists already. // Create a new one otherwise @@ -201,7 +201,7 @@ void AddApplicationDialog::accept() replaceMap.insert(varname, subProject->variables[varname]); AutoProjectTool::addToMakefileam(subProject->path + "/Makefile.am", replaceMap); - QDialog::accept(); + TQDialog::accept(); } #include "addapplicationdlg.moc" |