diff options
Diffstat (limited to 'parts/filelist/projectviewpart.cpp')
-rw-r--r-- | parts/filelist/projectviewpart.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/parts/filelist/projectviewpart.cpp b/parts/filelist/projectviewpart.cpp index 9313e7ef..91b46b53 100644 --- a/parts/filelist/projectviewpart.cpp +++ b/parts/filelist/projectviewpart.cpp @@ -24,17 +24,17 @@ #include "filelist_widget.h" #include "toolbarguibuilder.h" -#include <qtimer.h> -#include <qpopupmenu.h> -#include <qwhatsthis.h> -#include <qvaluelist.h> -#include <qmap.h> -#include <qdir.h> -#include <qdom.h> -#include <qvbox.h> -#include <qhbox.h> -#include <qpoint.h> -#include <qlayout.h> +#include <tqtimer.h> +#include <tqpopupmenu.h> +#include <tqwhatsthis.h> +#include <tqvaluelist.h> +#include <tqmap.h> +#include <tqdir.h> +#include <tqdom.h> +#include <tqvbox.h> +#include <tqhbox.h> +#include <tqpoint.h> +#include <tqlayout.h> #include <kmainwindow.h> #include <kinputdialog.h> @@ -68,7 +68,7 @@ K_EXPORT_COMPONENT_FACTORY(libkdevfilelist, projectviewFactory(data)) #define GLOBALDOC_OPTIONS 1 #define PROJECTDOC_OPTIONS 2 -ProjectviewPart::ProjectviewPart(QObject *parent, const char *name, const QStringList &/*args*/) +ProjectviewPart::ProjectviewPart(TQObject *parent, const char *name, const TQStringList &/*args*/) : KDevPlugin(&data, parent, name ? name : "FileListPart") { setInstance(projectviewFactory::instance()); @@ -79,26 +79,26 @@ ProjectviewPart::ProjectviewPart(QObject *parent, const char *name, const QStrin m_configProxy->createGlobalConfigPage(i18n("File List"), GLOBALDOC_OPTIONS, info()->icon()); m_configProxy->createProjectConfigPage(i18n("File List"), PROJECTDOC_OPTIONS, info()->icon()); - connect(m_configProxy, SIGNAL(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int)), - this, SLOT(insertConfigWidget(const KDialogBase*, QWidget*, unsigned int))); + connect(m_configProxy, TQT_SIGNAL(insertConfigWidget(const KDialogBase*, TQWidget*, unsigned int)), + this, TQT_SLOT(insertConfigWidget(const KDialogBase*, TQWidget*, unsigned int))); - connect(core(), SIGNAL(contextMenu(QPopupMenu *, const Context *)), - this, SLOT(contextMenu(QPopupMenu *, const Context *))); + connect(core(), TQT_SIGNAL(contextMenu(TQPopupMenu *, const Context *)), + this, TQT_SLOT(contextMenu(TQPopupMenu *, const Context *))); - connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened())); - connect(core(), SIGNAL(projectClosed()), this, SLOT(projectClosed())); + connect(core(), TQT_SIGNAL(projectOpened()), this, TQT_SLOT(projectOpened())); + connect(core(), TQT_SIGNAL(projectClosed()), this, TQT_SLOT(projectClosed())); KConfig * config = kapp->config(); config->setGroup("File List Plugin"); if (config->readBoolEntry("ToolbarInToolview", true)) { - m_toolbarWidget = new QVBox(0, "toolbarContainer"); + m_toolbarWidget = new TQVBox(0, "toolbarContainer"); m_toolbarWidget->setHidden(true); m_guibuilder = new ToolbarGUIBuilder(m_toolbarWidget, mainWindow()->main()); setClientBuilder(m_guibuilder); } m_restored = false; - QTimer::singleShot(0, this, SLOT(init())); + TQTimer::singleShot(0, this, TQT_SLOT(init())); } ProjectviewPart::~ProjectviewPart() @@ -111,7 +111,7 @@ ProjectviewPart::~ProjectviewPart() } } -void ProjectviewPart::restorePartialProjectSession(const QDomElement * el) +void ProjectviewPart::restorePartialProjectSession(const TQDomElement * el) { m_projectViews.clear(); // remove the global views m_restored = true; @@ -120,7 +120,7 @@ void ProjectviewPart::restorePartialProjectSession(const QDomElement * el) return; } // get the base of the project - QString urlStr = project()->projectDirectory(); + TQString urlStr = project()->projectDirectory(); if (KURL::isRelativeURL(urlStr)) { m_projectBase.setProtocol("file"); @@ -132,28 +132,28 @@ void ProjectviewPart::restorePartialProjectSession(const QDomElement * el) m_projectBase.adjustPath(+1); // just in case // read all the views - QDomNodeList domList = el->elementsByTagName("projectview"); + TQDomNodeList domList = el->elementsByTagName("projectview"); uint len = domList.length(); for (uint i = 0; i < len; ++i) { - const QDomElement viewEl = domList.item(i).toElement(); + const TQDomElement viewEl = domList.item(i).toElement(); if (viewEl.isNull()) { continue; } FileInfoList urlList; - QDomNodeList fileList = viewEl.elementsByTagName("file"); + TQDomNodeList fileList = viewEl.elementsByTagName("file"); uint len2 = fileList.length(); for (uint i2 = 0; i2 < len2; ++i2) { - const QDomElement fileEl = fileList.item(i2).toElement(); + const TQDomElement fileEl = fileList.item(i2).toElement(); if (!fileEl.isNull()) { bool ok; int line = -1; - QString attr = fileEl.attribute("line"); + TQString attr = fileEl.attribute("line"); if (! attr.isNull()) { line = attr.toInt(&ok); @@ -168,13 +168,13 @@ void ProjectviewPart::restorePartialProjectSession(const QDomElement * el) if (!ok) col = -1; } - QString encoding = ""; + TQString encoding = ""; attr = fileEl.attribute("encoding"); if (! attr.isNull()) { encoding = attr; } - QString urlStr = fileEl.attribute("url"); + TQString urlStr = fileEl.attribute("url"); if (KURL::isRelativeURL(urlStr)) { KURL url = m_projectBase; @@ -201,13 +201,13 @@ void ProjectviewPart::restorePartialProjectSession(const QDomElement * el) } } -void ProjectviewPart::savePartialProjectSession(QDomElement * el) +void ProjectviewPart::savePartialProjectSession(TQDomElement * el) { if (!el || m_projectViews.empty()) { return; } - QDomDocument domDoc = el->ownerDocument(); + TQDomDocument domDoc = el->ownerDocument(); if (domDoc.isNull()) { return; @@ -217,12 +217,12 @@ void ProjectviewPart::savePartialProjectSession(QDomElement * el) for (it = m_projectViews.constBegin(); it != m_projectViews.constEnd(); ++it) { // we create the view even if there is no file inside, might be wanted by the user - QDomElement viewEl = domDoc.createElement("projectview"); + TQDomElement viewEl = domDoc.createElement("projectview"); viewEl.setAttribute("name", it.key()); el->appendChild(viewEl); for (FileInfoList::ConstIterator it2 = it.data().constBegin(); it2 != it.data().constEnd(); ++it2) { - QDomElement urlEl = domDoc.createElement("file"); + TQDomElement urlEl = domDoc.createElement("file"); if (m_projectBase.isParentOf((*it2).url)) urlEl.setAttribute("url", KURL::relativeURL(m_projectBase, (*it2).url)); @@ -235,7 +235,7 @@ void ProjectviewPart::savePartialProjectSession(QDomElement * el) } } // write the default view - QDomElement defaultEl = domDoc.createElement("defaultview"); + TQDomElement defaultEl = domDoc.createElement("defaultview"); defaultEl.setAttribute("name", m_defaultProjectView); el->appendChild(defaultEl); } @@ -246,24 +246,24 @@ void ProjectviewPart::init() // delayed initialization stuff goes here // create the toolview - m_widget = new QWidget(0, "filelist widget"); + m_widget = new TQWidget(0, "filelist widget"); m_widget->setIcon( SmallIcon(info()->icon()) ); m_widget->setCaption(i18n("File List")); - QBoxLayout * l = new QVBoxLayout(m_widget); + TQBoxLayout * l = new TQVBoxLayout(m_widget); // create the toolbar if needed if (m_guibuilder) { - m_toolbarWidget->reparent(m_widget, QPoint(0, 0), true); + m_toolbarWidget->reparent(m_widget, TQPoint(0, 0), true); l->addWidget(m_toolbarWidget); - QWhatsThis::add(m_toolbarWidget, i18n("<b>View Session Toolbar</b><p>This allows to create and work with view sessions. A view session is a set of open documents.</p>")); + TQWhatsThis::add(m_toolbarWidget, i18n("<b>View Session Toolbar</b><p>This allows to create and work with view sessions. A view session is a set of open documents.</p>")); } // create the listview - QWidget * fileListWidget = new FileListWidget(this, m_widget); + TQWidget * fileListWidget = new FileListWidget(this, m_widget); fileListWidget->setCaption(i18n("File List")); - QWhatsThis::add(fileListWidget, i18n("<b>File List</b><p>This is the list of opened files.</p>")); + TQWhatsThis::add(fileListWidget, i18n("<b>File List</b><p>This is the list of opened files.</p>")); l->addWidget(fileListWidget); m_widget->setFocusProxy(fileListWidget); @@ -277,28 +277,28 @@ void ProjectviewPart::setupActions() { m_openPrjViewAction = new KSelectAction(i18n("Open Session..."), 0, actionCollection(), "viewsession_open"); - connect(m_openPrjViewAction, SIGNAL(activated(const QString &)), this, SLOT(slotOpenProjectView(const QString &))); + connect(m_openPrjViewAction, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(slotOpenProjectView(const TQString &))); m_openPrjViewAction->setToolTip(i18n("Open Session")); - m_savePrjViewAction = new KAction(i18n("Save Session"), "filesave", 0, this, SLOT(slotSaveProjectView()), actionCollection(), "viewsession_save"); + m_savePrjViewAction = new KAction(i18n("Save Session"), "filesave", 0, this, TQT_SLOT(slotSaveProjectView()), actionCollection(), "viewsession_save"); - m_newPrjViewAction = new KAction(i18n("New Session..."), "filenew", 0, this, SLOT(slotSaveAsProjectView()), actionCollection(), "viewsession_new"); + m_newPrjViewAction = new KAction(i18n("New Session..."), "filenew", 0, this, TQT_SLOT(slotSaveAsProjectView()), actionCollection(), "viewsession_new"); m_deletePrjViewAction = new KSelectAction(i18n("Delete Session"), "editdelete", 0, actionCollection(), "viewsession_delete"); - connect(m_deletePrjViewAction, SIGNAL(activated(const QString &)), this, SLOT(slotDeleteProjectView(const QString &))); + connect(m_deletePrjViewAction, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(slotDeleteProjectView(const TQString &))); m_deletePrjViewAction->setToolTip(i18n("Delete Session")); - m_deleteCurrentPrjViewAction = new KAction(i18n("Delete Session"), "editdelete", 0, this, SLOT(slotDeleteProjectViewCurent()), actionCollection(), "viewsession_deletecurrent"); + m_deleteCurrentPrjViewAction = new KAction(i18n("Delete Session"), "editdelete", 0, this, TQT_SLOT(slotDeleteProjectViewCurent()), actionCollection(), "viewsession_deletecurrent"); m_deleteCurrentPrjViewAction->setToolTip(i18n("Delete Session")); adjustViewActions(); } -void ProjectviewPart::insertConfigWidget(const KDialogBase *dlg, QWidget *page, unsigned int pageNo) +void ProjectviewPart::insertConfigWidget(const KDialogBase *dlg, TQWidget *page, unsigned int pageNo) { // create configuraton dialogs here switch (pageNo) @@ -306,19 +306,19 @@ void ProjectviewPart::insertConfigWidget(const KDialogBase *dlg, QWidget *page, case PROJECTDOC_OPTIONS: { ProjectviewProjectConfig *w = new ProjectviewProjectConfig(this, page, "project config"); - connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + connect(dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept())); break; } case GLOBALDOC_OPTIONS: { ProjectviewConfig *w = new ProjectviewConfig(page, "global config"); - connect(dlg, SIGNAL(okClicked()), w, SLOT(accept())); + connect(dlg, TQT_SIGNAL(okClicked()), w, TQT_SLOT(accept())); break; } } } -void ProjectviewPart::contextMenu(QPopupMenu */*popup*/, const Context */*context*/) +void ProjectviewPart::contextMenu(TQPopupMenu */*popup*/, const Context */*context*/) { // put actions into the context menu here // if (context->hasType(Context::EditorContext)) @@ -332,7 +332,7 @@ void ProjectviewPart::contextMenu(QPopupMenu */*popup*/, const Context */*contex // // or create menu items on the fly // // int id = -1; // // id = popup->insertItem(i18n("Do Something Here"), -// // this, SLOT(doSomething())); +// // this, TQT_SLOT(doSomething())); // // popup->setWhatsThis(id, i18n("<b>Do something here</b><p>Describe here what does this action do." // } // else if (context->hasType(Context::FileContext)) @@ -380,7 +380,7 @@ void ProjectviewPart::projectClosed() readConfig(); // read the global project views } -void ProjectviewPart::slotOpenProjectView(const QString &view) +void ProjectviewPart::slotOpenProjectView(const TQString &view) { KConfig * config = kapp->config(); config->setGroup("File List Plugin"); @@ -435,7 +435,7 @@ void ProjectviewPart::slotSaveProjectView() void ProjectviewPart::adjustViewActions() { - QStringList viewList = getViewList(); + TQStringList viewList = getViewList(); m_openPrjViewAction->clear(); m_openPrjViewAction->setItems(viewList); @@ -462,7 +462,7 @@ void ProjectviewPart::slotDeleteProjectViewCurent() slotDeleteProjectView(m_currentProjectView); } -void ProjectviewPart::slotDeleteProjectView(const QString& view) +void ProjectviewPart::slotDeleteProjectView(const TQString& view) { m_projectViews.remove(view); @@ -484,14 +484,14 @@ void ProjectviewPart::slotSaveAsProjectView(bool askForName) if (askForName) { bool ok; - QString newProjectView = KInputDialog::getText(i18n("Save View Session As"), i18n("Enter the name of the session:"), "", &ok, mainWindow()->main()); + TQString newProjectView = KInputDialog::getText(i18n("Save View Session As"), i18n("Enter the name of the session:"), "", &ok, mainWindow()->main()); if (!ok) { return; } newProjectView = newProjectView.remove("="); // we use this string in config files and = would confuse it if (m_projectViews.contains(newProjectView) > 0 && - KMessageBox::warningContinueCancel(mainWindow()->main(), i18n("<qt>A view session named <b>%1</b> already exists.<br>Do you want to overwrite it?</qt>").arg(newProjectView), QString::null, i18n("Overwrite")) != KMessageBox::Continue) + KMessageBox::warningContinueCancel(mainWindow()->main(), i18n("<qt>A view session named <b>%1</b> already exists.<br>Do you want to overwrite it?</qt>").arg(newProjectView), TQString::null, i18n("Overwrite")) != KMessageBox::Continue) { return; } @@ -509,10 +509,10 @@ void ProjectviewPart::slotSaveAsProjectView(bool askForName) KTextEditor::ViewCursorInterface* cursorIf = dynamic_cast<KTextEditor::ViewCursorInterface*>(ro_part->widget()); if (cursorIf) { - QString encoding; + TQString encoding; if ( KTextEditor::EncodingInterface * ei = dynamic_cast<KTextEditor::EncodingInterface*>( ro_part ) ) { - QString temp = ei->encoding(); + TQString temp = ei->encoding(); if ( !temp.isNull() ) { encoding = temp; @@ -544,7 +544,7 @@ void ProjectviewPart::writeConfig() for (it = m_projectViews.constBegin(); it != m_projectViews.constEnd(); ++it) { // we create the view even if there is no file inside, might be wanted by the user - QStringList urls; + TQStringList urls; for (FileInfoList::ConstIterator it2 = it.data().constBegin(); it2 != it.data().constEnd(); ++it2) { if ((*it2).encoding.isEmpty()) @@ -560,18 +560,18 @@ void ProjectviewPart::writeConfig() void ProjectviewPart::readConfig() { KConfig * config = kapp->config(); - QMap<QString, QString> entries = config->entryMap("ProjectViews"); + TQMap<TQString, TQString> entries = config->entryMap("ProjectViews"); m_projectViews.clear(); - QMap<QString, QString>::ConstIterator it; + TQMap<TQString, TQString>::ConstIterator it; for (it = entries.constBegin(); it != entries.constEnd(); ++it) { FileInfoList urlList; - QStringList urls = QStringList::split(",", it.data()); - for (QStringList::Iterator it2 = urls.begin(); it2 != urls.end(); ++it2 ) + TQStringList urls = TQStringList::split(",", it.data()); + for (TQStringList::Iterator it2 = urls.begin(); it2 != urls.end(); ++it2 ) { // search the encoding. The entry can be like: fileURL;encoding - QStringList file = QStringList::split(";", *it2); + TQStringList file = TQStringList::split(";", *it2); if (file.count() == 1) urlList.append(FileInfo(KURL::fromPathOrURL(*it2))); else |