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/removefiledlg.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/removefiledlg.cpp')
-rw-r--r-- | buildtools/autotools/removefiledlg.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/buildtools/autotools/removefiledlg.cpp b/buildtools/autotools/removefiledlg.cpp index 2c3bc37f..e265a969 100644 --- a/buildtools/autotools/removefiledlg.cpp +++ b/buildtools/autotools/removefiledlg.cpp @@ -11,13 +11,13 @@ #include "removefiledlg.h" -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qfile.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qregexp.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqfile.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqregexp.h> #include <kbuttonbox.h> #include <kdebug.h> @@ -31,9 +31,9 @@ #include "autoprojectwidget.h" #include "autodetailsview.h" -static bool fileListContains(const QPtrList<FileItem> &list, const QString &name) +static bool fileListContains(const TQPtrList<FileItem> &list, const TQString &name) { - QPtrListIterator<FileItem> it(list); + TQPtrListIterator<FileItem> it(list); for (; it.current(); ++it) if ((*it)->text(0) == name) return true; @@ -42,29 +42,29 @@ static bool fileListContains(const QPtrList<FileItem> &list, const QString &name RemoveFileDialog::RemoveFileDialog(AutoProjectWidget *widget, AutoProjectPart* part, SubprojectItem *spitem, - TargetItem *item, const QString &filename, - QWidget *parent, const char *name) + TargetItem *item, const TQString &filename, + TQWidget *parent, const char *name) : RemoveFileDlgBase(parent, name, true) { removeFromTargetsCheckBox = 0; - QStringList targets; + TQStringList targets; - QPtrListIterator<TargetItem> it(spitem->targets); + TQPtrListIterator<TargetItem> it(spitem->targets); for (; it.current(); ++it) if (fileListContains((*it)->sources, filename)) targets.append((*it)->name); if (targets.count() > 1) { - removeFromTargetsCheckBox = new QCheckBox( fileGroupBox, "removeFromTargetsCheckBox" ); - removeFromTargetsCheckBox->setMinimumSize( QSize( 0, 45 ) ); + removeFromTargetsCheckBox = new TQCheckBox( fileGroupBox, "removeFromTargetsCheckBox" ); + removeFromTargetsCheckBox->setMinimumSize( TQSize( 0, 45 ) ); fileLayout->addWidget( removeFromTargetsCheckBox ); - QString joinedtargets = " *" + targets.join("\n *"); + TQString joinedtargets = " *" + targets.join("\n *"); removeFromTargetsCheckBox->setText ( i18n ( "The file %1 is still used by the following targets:\n%2\n" "Remove it from all of them?").arg(filename).arg(joinedtargets) ); - setMinimumSize(QSize(size().width(), size().height() + removeFromTargetsCheckBox->size().height()*2) ); + setMinimumSize(TQSize(size().width(), size().height() + removeFromTargetsCheckBox->size().height()*2) ); } removeLabel->setText ( i18n ( "Do you really want to remove <b>%1</b>?" ).arg ( filename ) ); @@ -75,8 +75,8 @@ RemoveFileDialog::RemoveFileDialog(AutoProjectWidget *widget, AutoProjectPart* p else targetLabel->setText ( item->name ); - connect ( removeButton, SIGNAL ( clicked() ), this, SLOT ( accept() ) ); - connect ( cancelButton, SIGNAL ( clicked() ), this, SLOT ( reject() ) ); + connect ( removeButton, TQT_SIGNAL ( clicked() ), this, TQT_SLOT ( accept() ) ); + connect ( cancelButton, TQT_SIGNAL ( clicked() ), this, TQT_SLOT ( reject() ) ); setIcon ( SmallIcon ( "editdelete.png" ) ); @@ -96,29 +96,29 @@ void RemoveFileDialog::accept() { m_widget->emitRemovedFile ( subProject->path.mid ( m_part->projectDirectory().length() + 1 ) + "/" + fileName ); - QMap<QString,QString> replaceMap; + TQMap<TQString,TQString> replaceMap; if (removeFromTargetsCheckBox && removeFromTargetsCheckBox->isChecked()) { - QPtrListIterator<TargetItem> it(subProject->targets); + TQPtrListIterator<TargetItem> it(subProject->targets); for (; it.current(); ++it) { if ((*it) != target && fileListContains((*it)->sources, fileName)) { FileItem *fitem = static_cast<FileItem*>((*it)->firstChild()); while (fitem) { FileItem *nextitem = static_cast<FileItem*>(fitem->nextSibling()); if (fitem->text(0) == fileName) { - QListView *lv = fitem->listView(); + TQListView *lv = fitem->listView(); lv->setSelected(fitem, false); (*it)->sources.remove(fitem); } fitem = nextitem; } - QString canontargetname = AutoProjectTool::canonicalize((*it)->name); - QString varname; + TQString canontargetname = AutoProjectTool::canonicalize((*it)->name); + TQString varname; if( (*it)->primary == "PROGRAMS" || (*it)->primary == "LIBRARIES" || (*it)->primary == "LTLIBRARIES" ) varname = canontargetname + "_SOURCES"; else varname = (*it)->prefix + "_" + (*it)->primary; - QStringList sources = QStringList::split(QRegExp("[ \t\n]"), subProject->variables[varname]); + TQStringList sources = TQStringList::split(TQRegExp("[ \t\n]"), subProject->variables[varname]); sources.remove(fileName); subProject->variables[varname] = sources.join(" "); replaceMap.insert(varname, fileName); @@ -126,11 +126,11 @@ void RemoveFileDialog::accept() } } - QString fileItemName; + TQString fileItemName; FileItem *fitem = static_cast<FileItem*>(target->firstChild()); while (fitem) { if (fitem->text(0) == fileName) { - QListView *lv = fitem->listView(); + TQListView *lv = fitem->listView(); lv->setSelected(fitem, false); fileItemName = fitem->name; target->sources.remove(fitem); @@ -138,13 +138,13 @@ void RemoveFileDialog::accept() } fitem = static_cast<FileItem*>(fitem->nextSibling()); } - QString canontargetname = AutoProjectTool::canonicalize(target->name); - QString varname; + TQString canontargetname = AutoProjectTool::canonicalize(target->name); + TQString varname; if( target->primary == "PROGRAMS" || target->primary == "LIBRARIES" || target->primary == "LTLIBRARIES" ) varname = canontargetname + "_SOURCES"; else varname = target->prefix + "_" + target->primary; - QStringList sources = QStringList::split(QRegExp("[ \t\n]"), subProject->variables[varname]); + TQStringList sources = TQStringList::split(TQRegExp("[ \t\n]"), subProject->variables[varname]); sources.remove(fileName); subProject->variables[varname] = sources.join(" "); replaceMap.insert(varname, fileName); @@ -152,31 +152,31 @@ void RemoveFileDialog::accept() AutoProjectTool::removeFromMakefileam(subProject->path + "/Makefile.am", replaceMap); // review configuration cleanup in the project file after removing subclassing related source - QDomDocument &dom = *(m_part->projectDom()); + TQDomDocument &dom = *(m_part->projectDom()); - QDomElement el = dom.documentElement(); - QDomNode el2 = el.namedItem("kdevautoproject"); - QDomNode el3 = el2.namedItem("subclassing"); + TQDomElement el = dom.documentElement(); + TQDomNode el2 = el.namedItem("kdevautoproject"); + TQDomNode el3 = el2.namedItem("subclassing"); - QDomNode n = el3.firstChild(); - QValueList<QDomNode> nodesToRemove; + TQDomNode n = el3.firstChild(); + TQValueList<TQDomNode> nodesToRemove; while ( !n.isNull() ) { - QDomNamedNodeMap attr = n.attributes(); - QString fpath = subProject->path + QString("/") + fileItemName; - QString relpath = fpath.remove(0, m_part->projectDirectory().length()); + TQDomNamedNodeMap attr = n.attributes(); + TQString fpath = subProject->path + TQString("/") + fileItemName; + TQString relpath = fpath.remove(0, m_part->projectDirectory().length()); if ((attr.item(0).nodeValue() == relpath) || (attr.item(1).nodeValue() == relpath) ) nodesToRemove.append(n); n = n.nextSibling(); } - QValueList<QDomNode>::iterator it; + TQValueList<TQDomNode>::iterator it; for ( it = nodesToRemove.begin(); it != nodesToRemove.end(); ++it ) el3.removeChild(*it); if (removeCheckBox->isChecked()) - QFile::remove(subProject->path + "/" + fileName); + TQFile::remove(subProject->path + "/" + fileName); - QDialog::accept(); + TQDialog::accept(); } #include "removefiledlg.moc" |