summaryrefslogtreecommitdiffstats
path: root/buildtools/autotools/configureoptionswidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /buildtools/autotools/configureoptionswidget.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-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/configureoptionswidget.cpp')
-rw-r--r--buildtools/autotools/configureoptionswidget.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/buildtools/autotools/configureoptionswidget.cpp b/buildtools/autotools/configureoptionswidget.cpp
index 7e2db214..0be8903b 100644
--- a/buildtools/autotools/configureoptionswidget.cpp
+++ b/buildtools/autotools/configureoptionswidget.cpp
@@ -11,15 +11,15 @@
#include "configureoptionswidget.h"
-#include <qcombobox.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qtimer.h>
-#include <qvalidator.h>
+#include <tqcombobox.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqtimer.h>
+#include <tqvalidator.h>
#include <klineedit.h>
#include <kdebug.h>
#include <kfiledialog.h>
@@ -37,10 +37,10 @@
class ServiceComboBox
{
public:
- static void insertStringList(QComboBox *combo, const QValueList<KService::Ptr> &list,
- QStringList *names, QStringList *execs)
+ static void insertStringList(TQComboBox *combo, const TQValueList<KService::Ptr> &list,
+ TQStringList *names, TQStringList *execs)
{
- QValueList<KService::Ptr>::ConstIterator it;
+ TQValueList<KService::Ptr>::ConstIterator it;
for (it = list.begin(); it != list.end(); ++it) {
combo->insertItem((*it)->comment());
(*names) << (*it)->desktopEntryName();
@@ -48,15 +48,15 @@ public:
kdDebug(9020) << "insertStringList item " << (*it)->name() << "," << (*it)->exec() << endl;
}
}
- static QString currentText(QComboBox *combo, const QStringList &names)
+ static TQString currentText(TQComboBox *combo, const TQStringList &names)
{
if (combo->currentItem() == -1)
- return QString::null;
+ return TQString::null;
return names[combo->currentItem()];
}
- static void setCurrentText(QComboBox *combo, const QString &str, const QStringList &names)
+ static void setCurrentText(TQComboBox *combo, const TQString &str, const TQStringList &names)
{
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
int i = 0;
for (it = names.begin(); it != names.end(); ++it) {
if (*it == str) {
@@ -69,14 +69,14 @@ public:
};
-ConfigureOptionsWidget::ConfigureOptionsWidget(AutoProjectPart *part, QWidget *parent, const char *name)
+ConfigureOptionsWidget::ConfigureOptionsWidget(AutoProjectPart *part, TQWidget *parent, const char *name)
: ConfigureOptionsWidgetBase(parent, name)
{
- config_combo->setValidator(new QRegExpValidator(QRegExp("^\\D.*"), this));
+ config_combo->setValidator(new TQRegExpValidator(TQRegExp("^\\D.*"), this));
m_part = part;
env_groupBox->setColumnLayout( 1, Qt::Vertical );
- QDomDocument &dom = *part->projectDom();
+ TQDomDocument &dom = *part->projectDom();
m_environmentVariablesWidget = new EnvironmentVariablesWidget(dom, "/kdevautoproject/general/envvars", env_groupBox);
coffers = KTrader::self()->query("KDevelop/CompilerOptions", "[X-KDevelop-Language] == 'C'");
@@ -98,7 +98,7 @@ ConfigureOptionsWidget::ConfigureOptionsWidget(AutoProjectPart *part, QWidget *p
config_combo->insertStringList(allConfigs);
dirty = false;
- currentConfig = QString::null;
+ currentConfig = TQString::null;
configChanged(part->currentBuildConfig());
fixLayout();
@@ -132,14 +132,14 @@ void ConfigureOptionsWidget::fixLayout()
}
-void ConfigureOptionsWidget::readSettings(const QString &config)
+void ConfigureOptionsWidget::readSettings(const TQString &config)
{
- QDomDocument dom = *m_part->projectDom();
- QString prefix = "/kdevautoproject/configurations/" + config + "/";
+ TQDomDocument dom = *m_part->projectDom();
+ TQString prefix = "/kdevautoproject/configurations/" + config + "/";
kdDebug(9020) << "Reading config from " << prefix << endl;
configargs_edit->setText(DomUtil::readEntry(dom, prefix + "configargs"));
- QString builddir = DomUtil::readEntry(dom, prefix + "builddir");
+ TQString builddir = DomUtil::readEntry(dom, prefix + "builddir");
if (builddir.isEmpty() && config != "default")
builddir = config;
builddir_edit->setText(builddir);
@@ -149,13 +149,13 @@ void ConfigureOptionsWidget::readSettings(const QString &config)
cppflags_edit->setText(DomUtil::readEntry(dom, prefix + "cppflags"));
ldflags_edit->setText(DomUtil::readEntry(dom, prefix + "ldflags"));
- QString ccompiler = DomUtil::readEntry(dom, prefix + "ccompiler");
- QString cxxcompiler = DomUtil::readEntry(dom, prefix + "cxxcompiler");
- QString f77compiler = DomUtil::readEntry(dom, prefix + "f77compiler");
+ TQString ccompiler = DomUtil::readEntry(dom, prefix + "ccompiler");
+ TQString cxxcompiler = DomUtil::readEntry(dom, prefix + "cxxcompiler");
+ TQString f77compiler = DomUtil::readEntry(dom, prefix + "f77compiler");
if (ccompiler.isEmpty()) {
kdDebug(9020) << "No c compiler set" << endl;
- QValueList<KService::Ptr>::ConstIterator it;
+ TQValueList<KService::Ptr>::ConstIterator it;
for (it = coffers.begin(); it != coffers.end(); ++it) {
if ((*it)->property("X-KDevelop-Default").toBool()) {
kdDebug(9020) << "Found default " << (*it)->name() << endl;
@@ -166,7 +166,7 @@ void ConfigureOptionsWidget::readSettings(const QString &config)
}
if (cxxcompiler.isEmpty()) {
kdDebug(9020) << "No cxx compiler set" << endl;
- QValueList<KService::Ptr>::ConstIterator it;
+ TQValueList<KService::Ptr>::ConstIterator it;
for (it = cxxoffers.begin(); it != cxxoffers.end(); ++it) {
if ((*it)->property("X-KDevelop-Default").toBool()) {
kdDebug(9020) << "Found default " << (*it)->name() << endl;
@@ -177,7 +177,7 @@ void ConfigureOptionsWidget::readSettings(const QString &config)
}
if (f77compiler.isEmpty()) {
kdDebug(9020) << "No c compiler set" << endl;
- QValueList<KService::Ptr>::ConstIterator it;
+ TQValueList<KService::Ptr>::ConstIterator it;
for (it = f77offers.begin(); it != f77offers.end(); ++it) {
if ((*it)->property("X-KDevelop-Default").toBool()) {
kdDebug(9020) << "Found default " << (*it)->name() << endl;
@@ -203,11 +203,11 @@ void ConfigureOptionsWidget::readSettings(const QString &config)
}
-void ConfigureOptionsWidget::saveSettings(const QString &config)
+void ConfigureOptionsWidget::saveSettings(const TQString &config)
{
m_environmentVariablesWidget->accept();
- QDomDocument dom = *m_part->projectDom();
- QString prefix = "/kdevautoproject/configurations/" + config + "/";
+ TQDomDocument dom = *m_part->projectDom();
+ TQString prefix = "/kdevautoproject/configurations/" + config + "/";
kdDebug(9020) << "Saving config under " << prefix << endl;
DomUtil::writeEntry(dom, prefix + "configargs", configargs_edit->text());
@@ -217,8 +217,8 @@ void ConfigureOptionsWidget::saveSettings(const QString &config)
DomUtil::writeEntry(dom, prefix + "cppflags", cppflags_edit->text());
DomUtil::writeEntry(dom, prefix + "ldflags", ldflags_edit->text());
- QFileInfo fi(m_part->buildDirectory());
- QDir dir(fi.dir());
+ TQFileInfo fi(m_part->buildDirectory());
+ TQDir dir(fi.dir());
dir.mkdir(fi.fileName());
DomUtil::writeEntry(dom, prefix + "ccompiler",
@@ -236,8 +236,8 @@ void ConfigureOptionsWidget::saveSettings(const QString &config)
DomUtil::writeEntry(dom, prefix + "cxxflags", cxxflags_edit->text());
DomUtil::writeEntry(dom, prefix + "f77flags", f77flags_edit->text());
- if (KMessageBox::questionYesNo(this, i18n("Re-run configure for %1 now?").arg(config), QString::null, i18n("Rerun"), i18n("Do Not Run")) == KMessageBox::Yes)
- QTimer::singleShot(0, m_part, SLOT(slotConfigure()));
+ if (KMessageBox::questionYesNo(this, i18n("Re-run configure for %1 now?").arg(config), TQString::null, i18n("Rerun"), i18n("Do Not Run")) == KMessageBox::Yes)
+ TQTimer::singleShot(0, m_part, TQT_SLOT(slotConfigure()));
}
@@ -251,7 +251,7 @@ void ConfigureOptionsWidget::setDirty()
void ConfigureOptionsWidget::builddirClicked()
{
- QString dir = builddir_edit->text();
+ TQString dir = builddir_edit->text();
dir = KFileDialog::getExistingDirectory(dir, this);
if (!dir.isNull())
builddir_edit->setText(dir);
@@ -259,13 +259,13 @@ void ConfigureOptionsWidget::builddirClicked()
void ConfigureOptionsWidget::topsourcedirClicked()
{
- QString dir = topsourcedir_edit->text();
+ TQString dir = topsourcedir_edit->text();
dir = KFileDialog::getExistingDirectory(dir, this);
if (!dir.isNull())
topsourcedir_edit->setText(dir);
}
-void ConfigureOptionsWidget::configComboTextChanged(const QString &config)
+void ConfigureOptionsWidget::configComboTextChanged(const TQString &config)
{
bool canAdd = !allConfigs.contains(config) && !config.contains("/") && !config.isEmpty();
bool canRemove = allConfigs.contains(config) && config != "default";
@@ -274,7 +274,7 @@ void ConfigureOptionsWidget::configComboTextChanged(const QString &config)
}
-void ConfigureOptionsWidget::configChanged(const QString &config)
+void ConfigureOptionsWidget::configChanged(const TQString &config)
{
if (config == currentConfig || !allConfigs.contains(config))
return;
@@ -294,7 +294,7 @@ void ConfigureOptionsWidget::configChanged(const QString &config)
void ConfigureOptionsWidget::configAdded()
{
- QString config = config_combo->currentText();
+ TQString config = config_combo->currentText();
allConfigs.append(config);
@@ -307,24 +307,24 @@ void ConfigureOptionsWidget::configAdded()
void ConfigureOptionsWidget::configRemoved()
{
- QString config = config_combo->currentText();
+ TQString config = config_combo->currentText();
- QDomDocument dom = *m_part->projectDom();
- QDomNode node = dom.documentElement().namedItem("kdevautoproject").namedItem("configurations");
+ TQDomDocument dom = *m_part->projectDom();
+ TQDomNode node = dom.documentElement().namedItem("kdevautoproject").namedItem("configurations");
node.removeChild(node.namedItem(config));
allConfigs.remove(config);
config_combo->clear();
config_combo->insertStringList(allConfigs);
- currentConfig = QString::null;
+ currentConfig = TQString::null;
configChanged("default");
}
void ConfigureOptionsWidget::cserviceChanged()
{
- QString exec = ServiceComboBox::currentText(cservice_combo, cservice_execs);
+ TQString exec = ServiceComboBox::currentText(cservice_combo, cservice_execs);
cbinary_edit->setText(exec);
kdDebug(9020) << "exec: " << exec << endl;
}
@@ -332,14 +332,14 @@ void ConfigureOptionsWidget::cserviceChanged()
void ConfigureOptionsWidget::cxxserviceChanged()
{
- QString exec = ServiceComboBox::currentText(cxxservice_combo, cxxservice_execs);
+ TQString exec = ServiceComboBox::currentText(cxxservice_combo, cxxservice_execs);
cxxbinary_edit->setText(exec);
}
void ConfigureOptionsWidget::f77serviceChanged()
{
- QString exec = ServiceComboBox::currentText(f77service_combo, f77service_execs);
+ TQString exec = ServiceComboBox::currentText(f77service_combo, f77service_execs);
f77binary_edit->setText(exec);
kdDebug(9020) << "exec: " << exec << endl;
}
@@ -347,11 +347,11 @@ void ConfigureOptionsWidget::f77serviceChanged()
void ConfigureOptionsWidget::cflagsClicked()
{
- QString name = ServiceComboBox::currentText(cservice_combo, cservice_names);
+ TQString name = ServiceComboBox::currentText(cservice_combo, cservice_names);
KDevCompilerOptions *plugin = createCompilerOptions(name);
if (plugin) {
- QString flags = plugin->exec(this, cflags_edit->text());
+ TQString flags = plugin->exec(this, cflags_edit->text());
cflags_edit->setText(flags);
delete plugin;
}
@@ -360,11 +360,11 @@ void ConfigureOptionsWidget::cflagsClicked()
void ConfigureOptionsWidget::cxxflagsClicked()
{
- QString name = ServiceComboBox::currentText(cxxservice_combo, cxxservice_names);
+ TQString name = ServiceComboBox::currentText(cxxservice_combo, cxxservice_names);
KDevCompilerOptions *plugin = createCompilerOptions(name);
if (plugin) {
- QString flags = plugin->exec(this, cxxflags_edit->text());
+ TQString flags = plugin->exec(this, cxxflags_edit->text());
cxxflags_edit->setText(flags);
delete plugin;
}
@@ -373,18 +373,18 @@ void ConfigureOptionsWidget::cxxflagsClicked()
void ConfigureOptionsWidget::f77flagsClicked()
{
- QString name = ServiceComboBox::currentText(f77service_combo, f77service_names);
+ TQString name = ServiceComboBox::currentText(f77service_combo, f77service_names);
KDevCompilerOptions *plugin = createCompilerOptions(name);
if (plugin) {
- QString flags = plugin->exec(this, f77flags_edit->text());
+ TQString flags = plugin->exec(this, f77flags_edit->text());
f77flags_edit->setText(flags);
delete plugin;
}
}
-KDevCompilerOptions *ConfigureOptionsWidget::createCompilerOptions(const QString &name)
+KDevCompilerOptions *ConfigureOptionsWidget::createCompilerOptions(const TQString &name)
{
KService::Ptr service = KService::serviceByDesktopName(name);
if (!service) {
@@ -392,20 +392,20 @@ KDevCompilerOptions *ConfigureOptionsWidget::createCompilerOptions(const QString
return 0;
}
- KLibFactory *factory = KLibLoader::self()->factory(QFile::encodeName(service->library()));
+ KLibFactory *factory = KLibLoader::self()->factory(TQFile::encodeName(service->library()));
if (!factory) {
- QString errorMessage = KLibLoader::self()->lastErrorMessage();
+ TQString errorMessage = KLibLoader::self()->lastErrorMessage();
KMessageBox::error(0, i18n("There was an error loading the module %1.\n"
"The diagnostics is:\n%2").arg(service->name()).arg(errorMessage));
exit(1);
}
- QStringList args;
- QVariant prop = service->property("X-KDevelop-Args");
+ TQStringList args;
+ TQVariant prop = service->property("X-KDevelop-Args");
if (prop.isValid())
- args = QStringList::split(" ", prop.toString());
+ args = TQStringList::split(" ", prop.toString());
- QObject *obj = factory->create(this, service->name().latin1(),
+ TQObject *obj = factory->create(this, service->name().latin1(),
"KDevCompilerOptions", args);
if (!obj->inherits("KDevCompilerOptions")) {