diff options
Diffstat (limited to 'kfilereplace/kfilereplaceview.cpp')
-rw-r--r-- | kfilereplace/kfilereplaceview.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/kfilereplace/kfilereplaceview.cpp b/kfilereplace/kfilereplaceview.cpp index 16ca82da..fc0d08aa 100644 --- a/kfilereplace/kfilereplaceview.cpp +++ b/kfilereplace/kfilereplaceview.cpp @@ -16,9 +16,9 @@ *****************************************************************************/ // Qt -#include <qwhatsthis.h> -#include <qmap.h> -#include <qfileinfo.h> +#include <tqwhatsthis.h> +#include <tqmap.h> +#include <tqfileinfo.h> // KDE #include <klistview.h> @@ -43,35 +43,35 @@ using namespace whatthisNameSpace; -KFileReplaceView::KFileReplaceView(RCOptions* info, QWidget *parent,const char *name):KFileReplaceViewWdg(parent,name) +KFileReplaceView::KFileReplaceView(RCOptions* info, TQWidget *parent,const char *name):KFileReplaceViewWdg(parent,name) { m_option = info; initGUI(); // connect events - connect(m_lvResults, SIGNAL(mouseButtonClicked(int, QListViewItem *, const QPoint &, int)), this, SLOT(slotMouseButtonClicked(int, QListViewItem *, const QPoint &))); - connect(m_lvResults_2, SIGNAL(mouseButtonClicked(int, QListViewItem *, const QPoint &, int)), this, SLOT(slotMouseButtonClicked(int, QListViewItem *, const QPoint &))); - connect(m_lvStrings, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(slotStringsEdit())); - connect(m_lvStrings_2, SIGNAL(doubleClicked(QListViewItem *)), this, SLOT(slotStringsEdit())); + connect(m_lvResults, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(slotMouseButtonClicked(int, TQListViewItem *, const TQPoint &))); + connect(m_lvResults_2, TQT_SIGNAL(mouseButtonClicked(int, TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(slotMouseButtonClicked(int, TQListViewItem *, const TQPoint &))); + connect(m_lvStrings, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); + connect(m_lvStrings_2, TQT_SIGNAL(doubleClicked(TQListViewItem *)), this, TQT_SLOT(slotStringsEdit())); whatsThis(); } -QString KFileReplaceView::currentPath() +TQString KFileReplaceView::currentPath() { - QListViewItem *lvi; + TQListViewItem *lvi; if(! m_lviCurrent) lvi = m_rv->currentItem(); - else lvi = (QListViewItem*) m_lviCurrent; + else lvi = (TQListViewItem*) m_lviCurrent; while (lvi->parent()) lvi = lvi->parent(); - return QString(lvi->text(1)+"/"+lvi->text(0)); + return TQString(lvi->text(1)+"/"+lvi->text(0)); } -void KFileReplaceView::showSemaphore(QString s) +void KFileReplaceView::showSemaphore(TQString s) { if(s == "green") { @@ -97,7 +97,7 @@ void KFileReplaceView::showSemaphore(QString s) void KFileReplaceView::stringsInvert(bool invertAll) { - QListViewItem* lviCurItem, + TQListViewItem* lviCurItem, * lviFirst; KListView* sv = getStringsView(); @@ -111,7 +111,7 @@ void KFileReplaceView::stringsInvert(bool invertAll) do { - QString searchText = lviCurItem->text(0), + TQString searchText = lviCurItem->text(0), replaceText = lviCurItem->text(1); // Cannot invert the string when search string is empty @@ -169,13 +169,13 @@ KListView* KFileReplaceView::getStringsView() } //PUBLIC SLOTS -void KFileReplaceView::slotMouseButtonClicked (int button, QListViewItem *lvi, const QPoint &pos) +void KFileReplaceView::slotMouseButtonClicked (int button, TQListViewItem *lvi, const TQPoint &pos) { if (lvi == 0) // No item selected return; // RIGHT BUTTON - if (button == QMouseEvent::RightButton) + if (button == TQMouseEvent::RightButton) { m_lviCurrent = static_cast<KListViewItem*>(lvi); m_menuResult->popup(pos); @@ -184,7 +184,7 @@ void KFileReplaceView::slotMouseButtonClicked (int button, QListViewItem *lvi, c void KFileReplaceView::slotResultProperties() { - QString currItem = currentPath(); + TQString currItem = currentPath(); if(! currItem.isEmpty()) { KURL url(currItem); @@ -195,7 +195,7 @@ void KFileReplaceView::slotResultProperties() void KFileReplaceView::slotResultOpen() { - QString currItem = currentPath(); + TQString currItem = currentPath(); if(!currItem.isEmpty()) { (void) new KRun(KURL(currItem), 0, true, true); @@ -205,7 +205,7 @@ void KFileReplaceView::slotResultOpen() void KFileReplaceView::slotResultOpenWith() { - QString currItem = currentPath(); + TQString currItem = currentPath(); if(!currItem.isEmpty()) { KURL::List kurls; @@ -217,10 +217,10 @@ void KFileReplaceView::slotResultOpenWith() void KFileReplaceView::slotResultDirOpen() { - QString currItem = currentPath(); + TQString currItem = currentPath(); if(!currItem.isEmpty()) { - QFileInfo fi; + TQFileInfo fi; fi.setFile(currItem); (void) new KRun (KURL::fromPathOrURL(fi.dirPath()), 0, true, true); m_lviCurrent = 0; @@ -229,14 +229,14 @@ void KFileReplaceView::slotResultDirOpen() void KFileReplaceView::slotResultEdit() { - QListViewItem *lvi = m_rv->firstChild(); + TQListViewItem *lvi = m_rv->firstChild(); while (lvi) { DCOPClient *client = kapp->dcopClient(); DCOPRef quanta(client->appId(),"WindowManagerIf"); - QString path = QString(lvi->text(1)+"/"+lvi->text(0)); - QListViewItem *lviChild = lvi; + TQString path = TQString(lvi->text(1)+"/"+lvi->text(0)); + TQListViewItem *lviChild = lvi; while(lviChild) { @@ -256,7 +256,7 @@ void KFileReplaceView::slotResultEdit() if(!success) { - QString message = i18n("File %1 cannot be opened. Might be a DCOP problem.").arg(path); + TQString message = i18n("File %1 cannot be opened. Might be a DCOP problem.").arg(path); KMessageBox::error(parentWidget(), message); } } @@ -274,12 +274,12 @@ void KFileReplaceView::slotResultEdit() void KFileReplaceView::slotResultDelete() { - QString currItem = currentPath(); + TQString currItem = currentPath(); if (!currItem.isEmpty()) { - QFile fi; + TQFile fi; int answer = KMessageBox::warningContinueCancel(this, i18n("Do you really want to delete %1?").arg(currItem), - QString::null,KStdGuiItem::del()); + TQString::null,KStdGuiItem::del()); if(answer == KMessageBox::Continue) { @@ -294,7 +294,7 @@ void KFileReplaceView::slotResultDelete() void KFileReplaceView::slotResultTreeExpand() { - QListViewItem *lviRoot = getResultsView()->firstChild(); + TQListViewItem *lviRoot = getResultsView()->firstChild(); if(lviRoot) expand(lviRoot, true); @@ -302,7 +302,7 @@ void KFileReplaceView::slotResultTreeExpand() void KFileReplaceView::slotResultTreeReduce() { - QListViewItem *lviRoot = getResultsView()->firstChild(); + TQListViewItem *lviRoot = getResultsView()->firstChild(); if(lviRoot) expand(lviRoot, false); @@ -331,14 +331,14 @@ void KFileReplaceView::slotStringsAdd() loadMapIntoView(addedStringsMap); } -void KFileReplaceView::slotQuickStringsAdd(const QString& quickSearch, const QString& quickReplace) +void KFileReplaceView::slotQuickStringsAdd(const TQString& quickSearch, const TQString& quickReplace) { if(!quickSearch.isEmpty()) { KeyValueMap map; if(quickReplace.isEmpty()) { - map[quickSearch] = QString::null; + map[quickSearch] = TQString::null; m_option->m_searchingOnlyMode = true; } else @@ -402,7 +402,7 @@ void KFileReplaceView::slotStringsSave() return ; } - QString header("<?xml version=\"1.0\" ?>\n<kfr>"), + TQString header("<?xml version=\"1.0\" ?>\n<kfr>"), footer("\n</kfr>"), body; if(m_option->m_searchingOnlyMode) @@ -410,11 +410,11 @@ void KFileReplaceView::slotStringsSave() else header += "\n\t<mode search=\"false\"/>"; - QListViewItem* lvi = sv->firstChild(); + TQListViewItem* lvi = sv->firstChild(); while( lvi ) { - body += QString("\n\t<replacement>" + body += TQString("\n\t<replacement>" "\n\t\t<oldstring><![CDATA[%1]]></oldstring>" "\n\t\t<newstring><![CDATA[%2]]></newstring>" "\n\t</replacement>").arg(lvi->text(0)).arg(lvi->text(1)); @@ -422,8 +422,8 @@ void KFileReplaceView::slotStringsSave() } // Selects the file where strings will be saved - QString menu = "*.kfr|" + i18n("KFileReplace Strings") + " (*.kfr)\n*|" + i18n("All Files") + " (*)"; - QString fileName = KFileDialog::getSaveFileName(QString::null, menu, 0, i18n("Save Strings to File")); + TQString menu = "*.kfr|" + i18n("KFileReplace Strings") + " (*.kfr)\n*|" + i18n("All Files") + " (*)"; + TQString fileName = KFileDialog::getSaveFileName(TQString::null, menu, 0, i18n("Save Strings to File")); if (fileName.isEmpty()) return; @@ -431,14 +431,14 @@ void KFileReplaceView::slotStringsSave() fileName = KFileReplaceLib::addExtension(fileName, "kfr"); - QFile file( fileName ); + TQFile file( fileName ); if(!file.open( IO_WriteOnly )) { KMessageBox::error(0, i18n("File %1 cannot be saved.").arg(fileName)); return ; } - QTextStream oTStream( &file ); - oTStream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream oTStream( &file ); + oTStream.setEncoding(TQTextStream::UnicodeUTF8); oTStream << header << body << footer; @@ -447,7 +447,7 @@ void KFileReplaceView::slotStringsSave() void KFileReplaceView::slotStringsDeleteItem() { - QListViewItem* item = m_sv->currentItem(); + TQListViewItem* item = m_sv->currentItem(); if(item != 0) { KeyValueMap m = m_option->m_mapStringsView; @@ -459,10 +459,10 @@ void KFileReplaceView::slotStringsDeleteItem() void KFileReplaceView::slotStringsEmpty() { - QListViewItem * myChild = m_sv->firstChild(); + TQListViewItem * myChild = m_sv->firstChild(); while( myChild ) { - QListViewItem* item = myChild; + TQListViewItem* item = myChild; myChild = myChild->nextSibling(); delete item; } @@ -498,15 +498,15 @@ void KFileReplaceView::initGUI() - m_menuResult->insertItem(SmallIconSet(QString::fromLatin1("fileopen")), + m_menuResult->insertItem(SmallIconSet(TQString::fromLatin1("fileopen")), i18n("&Open"), this, - SLOT(slotResultOpen())); + TQT_SLOT(slotResultOpen())); if(!quantaFound) { m_menuResult->insertItem(i18n("Open &With..."), this, - SLOT(slotResultOpenWith())); + TQT_SLOT(slotResultOpenWith())); } if(quantaFound) @@ -514,22 +514,22 @@ void KFileReplaceView::initGUI() m_menuResult->insertItem(SmallIconSet("quanta"), i18n("&Edit in Quanta"), this, - SLOT(slotResultEdit())); + TQT_SLOT(slotResultEdit())); } - m_menuResult->insertItem(SmallIconSet(QString::fromLatin1("up")), + m_menuResult->insertItem(SmallIconSet(TQString::fromLatin1("up")), i18n("Open Parent &Folder"), this, - SLOT(slotResultDirOpen())); - m_menuResult->insertItem(SmallIconSet(QString::fromLatin1("editdelete")), + TQT_SLOT(slotResultDirOpen())); + m_menuResult->insertItem(SmallIconSet(TQString::fromLatin1("editdelete")), i18n("&Delete"), this, - SLOT(slotResultDelete())); + TQT_SLOT(slotResultDelete())); m_menuResult->insertSeparator(); - m_menuResult->insertItem(SmallIconSet(QString::fromLatin1("info")), + m_menuResult->insertItem(SmallIconSet(TQString::fromLatin1("info")), i18n("&Properties"), this, - SLOT(slotResultProperties())); + TQT_SLOT(slotResultProperties())); raiseResultsView(); raiseStringsView(); } @@ -554,18 +554,18 @@ void KFileReplaceView::raiseResultsView() m_stackResults->raiseWidget(m_rv); } -coord KFileReplaceView::extractWordCoordinates(QListViewItem* lvi) +coord KFileReplaceView::extractWordCoordinates(TQListViewItem* lvi) { //get coordinates of the first string of the current selected file coord c; c.line = 0; c.column = 0; - QString s = lvi->text(0); + TQString s = lvi->text(0); //qWarning("WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW=%s",s.latin1()); /* if(lvi->parent()) s = lvi->text(0); else return c;*/ - QString temp; + TQString temp; int i = 0; //extracts line and column from lvi->text(0) @@ -591,7 +591,7 @@ coord KFileReplaceView::extractWordCoordinates(QListViewItem* lvi) break; } c.line = temp.toInt(); - temp = QString::null; + temp = TQString::null; while(true) { @@ -618,7 +618,7 @@ coord KFileReplaceView::extractWordCoordinates(QListViewItem* lvi) return c; } -void KFileReplaceView::expand(QListViewItem *lviCurrent, bool b) +void KFileReplaceView::expand(TQListViewItem *lviCurrent, bool b) { // current item lviCurrent->setOpen(b); @@ -636,11 +636,11 @@ void KFileReplaceView::expand(QListViewItem *lviCurrent, bool b) void KFileReplaceView::setMap() { KeyValueMap map; - QListViewItem* i = m_sv->firstChild(); + TQListViewItem* i = m_sv->firstChild(); while(i != 0) { if(m_option->m_searchingOnlyMode) - map[i->text(0)] = QString::null; + map[i->text(0)] = TQString::null; else map[i->text(0)] = i->text(1); i = i->nextSibling(); @@ -655,7 +655,7 @@ void KFileReplaceView::loadMapIntoView(KeyValueMap map) for(itMap = map.begin(); itMap != map.end(); ++itMap) { - QListViewItem* lvi = new QListViewItem(m_sv); + TQListViewItem* lvi = new TQListViewItem(m_sv); lvi->setMultiLinesEnabled(true); lvi->setText(0,itMap.key()); if(!m_option->m_searchingOnlyMode) @@ -666,7 +666,7 @@ void KFileReplaceView::loadMapIntoView(KeyValueMap map) void KFileReplaceView::whatsThis() { - QWhatsThis::add(getResultsView(), lvResultWhatthis); - QWhatsThis::add(getStringsView(), lvStringsWhatthis); + TQWhatsThis::add(getResultsView(), lvResultWhatthis); + TQWhatsThis::add(getStringsView(), lvStringsWhatthis); } #include "kfilereplaceview.moc" |