diff options
Diffstat (limited to 'quanta/treeviews/templatestreeview.cpp')
-rw-r--r-- | quanta/treeviews/templatestreeview.cpp | 270 |
1 files changed, 135 insertions, 135 deletions
diff --git a/quanta/treeviews/templatestreeview.cpp b/quanta/treeviews/templatestreeview.cpp index e87e2428..0b9973e8 100644 --- a/quanta/treeviews/templatestreeview.cpp +++ b/quanta/treeviews/templatestreeview.cpp @@ -19,19 +19,19 @@ #include <sys/types.h> // QT includes -#include <qbuttongroup.h> -#include <qcheckbox.h> -#include <qclipboard.h> -#include <qdir.h> -#include <qpixmap.h> -#include <qheader.h> -#include <qpoint.h> -#include <qlayout.h> -#include <qtextedit.h> -#include <qregexp.h> -#include <qlabel.h> -#include <qmap.h> -#include <qwidgetstack.h> +#include <tqbuttongroup.h> +#include <tqcheckbox.h> +#include <tqclipboard.h> +#include <tqdir.h> +#include <tqpixmap.h> +#include <tqheader.h> +#include <tqpoint.h> +#include <tqlayout.h> +#include <tqtextedit.h> +#include <tqregexp.h> +#include <tqlabel.h> +#include <tqmap.h> +#include <tqwidgetstack.h> // KDE includes #include <kapplication.h> @@ -70,17 +70,17 @@ #define NONE "None" -const QString textMenu = I18N_NOOP("Insert as &Text"); -const QString binaryMenu = I18N_NOOP("Insert &Link to File"); -const QString docMenu = I18N_NOOP("&New Document Based on This"); -const QString siteMenu = I18N_NOOP("&Extract Site Template To..."); -QMap<QString, QString> typeToi18n; -QMap<QString, QString> i18nToType; +const TQString textMenu = I18N_NOOP("Insert as &Text"); +const TQString binaryMenu = I18N_NOOP("Insert &Link to File"); +const TQString docMenu = I18N_NOOP("&New Document Based on This"); +const TQString siteMenu = I18N_NOOP("&Extract Site Template To..."); +TQMap<TQString, TQString> typeToi18n; +TQMap<TQString, TQString> i18nToType; //TemplatesTreeBranch implementation TemplatesTreeBranch::TemplatesTreeBranch(KFileTreeView *parent, const KURL& url, - const QString& name, const QPixmap& pix, + const TQString& name, const TQPixmap& pix, bool showHidden, KFileTreeViewItem *branchRoot) : BaseTreeBranch(parent, url, name, pix, showHidden, branchRoot) @@ -99,7 +99,7 @@ KFileTreeViewItem* TemplatesTreeBranch::createTreeViewItem(KFileTreeViewItem *pa { if (url.isLocalFile()) { - QDir dir (url.path(), "", QDir::All); + TQDir dir (url.path(), "", TQDir::All); tvi->setExpandable(dir.count() != 2); // . and .. are always there } else { tvi->setExpandable(true); // we assume there is something @@ -108,15 +108,15 @@ KFileTreeViewItem* TemplatesTreeBranch::createTreeViewItem(KFileTreeViewItem *pa { url = static_cast<BaseTreeViewItem*>(parent)->url(); } - QFileInfo dotFileInfo(url.path() + "/.dirinfo"); + TQFileInfo dotFileInfo(url.path() + "/.dirinfo"); while ((!dotFileInfo.exists()) && (dotFileInfo.dirPath() != "/")) { - dotFileInfo.setFile(QFileInfo(dotFileInfo.dirPath()).dirPath()+"/.dirinfo"); + dotFileInfo.setFile(TQFileInfo(dotFileInfo.dirPath()).dirPath()+"/.dirinfo"); } if (dotFileInfo.exists()) { KConfig *config = new KConfig(dotFileInfo.filePath()); - QString s = config->readEntry("Type"); + TQString s = config->readEntry("Type"); tvi->setText(1, typeToi18n[s]); delete config; } @@ -143,35 +143,35 @@ TemplatesTreeView::TemplatesTreeView(KMainWindow *parent, const char *name ) m_fileMenu = new KPopupMenu(this); - m_openId = m_fileMenu->insertItem(i18n("Open"), this ,SLOT(slotInsert())); - m_fileMenu->insertItem(SmallIcon("fileopen"), i18n("&Open"), this ,SLOT(slotOpen())); - m_fileMenu->insertItem(SmallIcon("mail_send"), i18n("Send in E&mail..."), this, SLOT(slotSendInMail())); - m_fileMenu->insertItem(SmallIcon("network"), i18n("&Upload Template..."), this, SLOT(slotUploadTemplate())); - m_insertFileInProject = m_fileMenu->insertItem(i18n("&Insert in Project..."), this, SLOT(slotInsertInProject())); - m_menuClose = m_fileMenu->insertItem(SmallIcon("fileclose"), i18n("Clos&e"), this, SLOT(slotClose())); + m_openId = m_fileMenu->insertItem(i18n("Open"), this ,TQT_SLOT(slotInsert())); + m_fileMenu->insertItem(SmallIcon("fileopen"), i18n("&Open"), this ,TQT_SLOT(slotOpen())); + m_fileMenu->insertItem(SmallIcon("mail_send"), i18n("Send in E&mail..."), this, TQT_SLOT(slotSendInMail())); + m_fileMenu->insertItem(SmallIcon("network"), i18n("&Upload Template..."), this, TQT_SLOT(slotUploadTemplate())); + m_insertFileInProject = m_fileMenu->insertItem(i18n("&Insert in Project..."), this, TQT_SLOT(slotInsertInProject())); + m_menuClose = m_fileMenu->insertItem(SmallIcon("fileclose"), i18n("Clos&e"), this, TQT_SLOT(slotClose())); m_fileMenu->insertSeparator(); - m_fileMenu->insertItem(SmallIcon("editcopy"), i18n("&Copy"), this, SLOT(slotCopy())); - m_fileMenu->insertItem(SmallIcon("editdelete"), i18n("&Delete"), this, SLOT(slotDelete())); + m_fileMenu->insertItem(SmallIcon("editcopy"), i18n("&Copy"), this, TQT_SLOT(slotCopy())); + m_fileMenu->insertItem(SmallIcon("editdelete"), i18n("&Delete"), this, TQT_SLOT(slotDelete())); m_fileMenu->insertSeparator(); - m_fileMenu->insertItem(SmallIcon("info"), i18n("&Properties"), this, SLOT(slotProperties())); + m_fileMenu->insertItem(SmallIcon("info"), i18n("&Properties"), this, TQT_SLOT(slotProperties())); m_folderMenu = new KPopupMenu(this); - m_folderMenu->insertItem(SmallIcon("folder_new"), i18n("&New Folder..."), this, SLOT(slotNewDir())); - m_folderMenu->insertItem(SmallIcon("mail_send"), i18n("Send in E&mail..."), this, SLOT(slotSendInMail())); - m_folderMenu->insertItem(SmallIcon("network"), i18n("&Upload Template..."), this, SLOT(slotUploadTemplate())); - m_downloadMenuId = m_folderMenu->insertItem(SmallIcon("network"), i18n("&Download Template..."), this, SIGNAL(downloadTemplate())); - m_insertFolderInProject = m_folderMenu->insertItem(i18n("&Insert in Project..."), this, SLOT(slotInsertDirInProject())); + m_folderMenu->insertItem(SmallIcon("folder_new"), i18n("&New Folder..."), this, TQT_SLOT(slotNewDir())); + m_folderMenu->insertItem(SmallIcon("mail_send"), i18n("Send in E&mail..."), this, TQT_SLOT(slotSendInMail())); + m_folderMenu->insertItem(SmallIcon("network"), i18n("&Upload Template..."), this, TQT_SLOT(slotUploadTemplate())); + m_downloadMenuId = m_folderMenu->insertItem(SmallIcon("network"), i18n("&Download Template..."), this, TQT_SIGNAL(downloadTemplate())); + m_insertFolderInProject = m_folderMenu->insertItem(i18n("&Insert in Project..."), this, TQT_SLOT(slotInsertDirInProject())); m_folderMenu->insertSeparator(); - m_folderMenu->insertItem(SmallIcon("editcopy"), i18n("&Copy"), this, SLOT(slotCopy())); - m_menuPasteFolder = m_folderMenu->insertItem(SmallIcon("editpaste"), i18n("&Paste"), this, SLOT(slotPaste())); - m_deleteMenuId = m_folderMenu->insertItem(SmallIcon("editdelete"), i18n("&Delete"), this, SLOT(slotDelete())); + m_folderMenu->insertItem(SmallIcon("editcopy"), i18n("&Copy"), this, TQT_SLOT(slotCopy())); + m_menuPasteFolder = m_folderMenu->insertItem(SmallIcon("editpaste"), i18n("&Paste"), this, TQT_SLOT(slotPaste())); + m_deleteMenuId = m_folderMenu->insertItem(SmallIcon("editdelete"), i18n("&Delete"), this, TQT_SLOT(slotDelete())); m_folderMenu->insertSeparator(); - m_folderMenu->insertItem(SmallIcon("info"), i18n("&Properties"), this, SLOT(slotProperties())); - m_reloadMenuId = m_folderMenu->insertItem(SmallIcon("revert"), i18n("&Reload"), this, SLOT(slotReload())); + m_folderMenu->insertItem(SmallIcon("info"), i18n("&Properties"), this, TQT_SLOT(slotProperties())); + m_reloadMenuId = m_folderMenu->insertItem(SmallIcon("revert"), i18n("&Reload"), this, TQT_SLOT(slotReload())); m_emptyAreaMenu = new KPopupMenu(this); - m_emptyAreaMenu->insertItem(SmallIcon("network"), i18n("&Download Template..."), this, SIGNAL(downloadTemplate())); + m_emptyAreaMenu->insertItem(SmallIcon("network"), i18n("&Download Template..."), this, TQT_SIGNAL(downloadTemplate())); addColumn(i18n("Templates"), -1); addColumn(i18n("Group"), -1); @@ -182,14 +182,14 @@ TemplatesTreeView::TemplatesTreeView(KMainWindow *parent, const char *name ) localURL.setPath(locateLocal("data", resourceDir + "templates/")); newBranch(localURL); - connect(this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), - this, SLOT(slotMenu(KListView*, QListViewItem*, const QPoint&))); + connect(this, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), + this, TQT_SLOT(slotMenu(KListView*, TQListViewItem*, const TQPoint&))); - connect(this, SIGNAL(open(QListViewItem *)), - this, SLOT(slotSelectFile(QListViewItem *))); + connect(this, TQT_SIGNAL(open(TQListViewItem *)), + this, TQT_SLOT(slotSelectFile(TQListViewItem *))); setAcceptDrops(true); - setSelectionMode(QListView::Single); + setSelectionMode(TQListView::Single); setDragEnabled(true); setSaveOpenFolder(true); restoreLayout( kapp->config(), className() ); @@ -223,7 +223,7 @@ KFileTreeBranch* TemplatesTreeView::newBranch(const KURL& url) addBranch(newBrnch); if (url.isLocalFile()) { - QDir dir (url.path(), "", QDir::All); + TQDir dir (url.path(), "", TQDir::All); newBrnch->root()->setExpandable(dir.count() != 2); // . and .. are always there } else { newBrnch->root()->setExpandable(true); // we assume there is something @@ -251,7 +251,7 @@ void TemplatesTreeView::slotInsertInDocument() } -void TemplatesTreeView::slotMenu(KListView*, QListViewItem *item, const QPoint &point) +void TemplatesTreeView::slotMenu(KListView*, TQListViewItem *item, const TQPoint &point) { if (!item) { @@ -283,7 +283,7 @@ void TemplatesTreeView::slotMenu(KListView*, QListViewItem *item, const QPoint & { m_dirInfo = readDirInfo(); - QString menuText = ""; + TQString menuText = ""; if (m_dirInfo.mimeType.upper().contains("TEXT")) menuText = i18n(textMenu.utf8()); @@ -313,7 +313,7 @@ void TemplatesTreeView::slotNewDocument() KURL url = filterTemplate(); if (QuantaCommon::checkMimeGroup(url, "text") || QuantaCommon::denyBinaryInsert(this) == KMessageBox::Yes) { - QListViewItem *item = currentItem(); + TQListViewItem *item = currentItem(); if (item ) { if ( currentKFileTreeViewItem() != currentKFileTreeViewItem()->branch()->root()) @@ -328,7 +328,7 @@ void TemplatesTreeView::slotNewDocument() /** Insert the template as text, image, new document. */ void TemplatesTreeView::slotInsert() { - QString menuText = m_fileMenu->text(m_openId); + TQString menuText = m_fileMenu->text(m_openId); if (menuText == i18n(textMenu.utf8())) slotInsertInDocument(); @@ -340,7 +340,7 @@ void TemplatesTreeView::slotInsert() slotExtractSiteTemplate(); } -void TemplatesTreeView::slotSelectFile(QListViewItem *item) +void TemplatesTreeView::slotSelectFile(TQListViewItem *item) { if ( !item ) return; @@ -390,9 +390,9 @@ void TemplatesTreeView::slotNewDir() } if (createDirDlg->exec()) { - QDir dir; + TQDir dir; - QString startDir = ""; + TQString startDir = ""; if ( !currentKFileTreeViewItem()->isDir() ) { startDir = currentURL().path(); @@ -400,7 +400,7 @@ void TemplatesTreeView::slotNewDir() { startDir = currentURL().path() + "/dummy_file"; } - startDir = QFileInfo(startDir).dirPath(); + startDir = TQFileInfo(startDir).dirPath(); if (!dir.mkdir(startDir+"/"+createDirDlg->dirName->text())) { KMessageBox::error(this,i18n("Error while creating the new folder.\n \ @@ -418,7 +418,7 @@ void TemplatesTreeView::slotNewDir() } /** No descriptions */ -QDragObject * TemplatesTreeView::dragObject () +TQDragObject * TemplatesTreeView::dragObject () { // don't drag folders if ( ! currentKFileTreeViewItem() || currentKFileTreeViewItem()->isDir() ) return 0; @@ -433,7 +433,7 @@ QDragObject * TemplatesTreeView::dragObject () } /** No descriptions */ -void TemplatesTreeView::contentsDropEvent(QDropEvent *e) +void TemplatesTreeView::contentsDropEvent(TQDropEvent *e) { if (KURLDrag::canDecode(e)) { @@ -441,9 +441,9 @@ void TemplatesTreeView::contentsDropEvent(QDropEvent *e) BaseTreeView::contentsDropEvent(e); return; } - if (QTextDrag::canDecode(e)) + if (TQTextDrag::canDecode(e)) { - QListViewItem *item = itemAt(contentsToViewport(e->pos())); + TQListViewItem *item = itemAt(contentsToViewport(e->pos())); if (item) { KURL dest; @@ -452,8 +452,8 @@ void TemplatesTreeView::contentsDropEvent(QDropEvent *e) else dest = currentURL().directory(false); dest.adjustPath(+1); - QString content; - QTextDrag::decode(e, content); + TQString content; + TQTextDrag::decode(e, content); KURL url =KURLRequesterDlg::getURL( dest.path() + "template.txt", this, i18n("Save selection as template file:")); if ( !url.isEmpty() ) @@ -461,7 +461,7 @@ void TemplatesTreeView::contentsDropEvent(QDropEvent *e) //now save the file KTempFile* tempFile = new KTempFile(tmpDir); tempFile->setAutoDelete(true); - tempFile->textStream()->setEncoding(QTextStream::UnicodeUTF8); + tempFile->textStream()->setEncoding(TQTextStream::UnicodeUTF8); *(tempFile->textStream()) << content; tempFile->close(); bool proceed = true; @@ -485,10 +485,10 @@ void TemplatesTreeView::contentsDropEvent(QDropEvent *e) } /** Reads a .dirinfo file from the selected item's path */ -DirInfo TemplatesTreeView::readDirInfo(const QString& dir) +DirInfo TemplatesTreeView::readDirInfo(const TQString& dir) { DirInfo dirInfo; - QString startDir = dir; + TQString startDir = dir; if (startDir.isEmpty()) { @@ -501,11 +501,11 @@ DirInfo TemplatesTreeView::readDirInfo(const QString& dir) } } - QFileInfo dotFileInfo(QFileInfo(startDir).dirPath()+"/.dirinfo"); + TQFileInfo dotFileInfo(TQFileInfo(startDir).dirPath()+"/.dirinfo"); while ((!dotFileInfo.exists()) && (dotFileInfo.dirPath() != "/")) { - dotFileInfo.setFile(QFileInfo(dotFileInfo.dirPath()).dirPath()+"/.dirinfo"); + dotFileInfo.setFile(TQFileInfo(dotFileInfo.dirPath()).dirPath()+"/.dirinfo"); } KConfig *config = new KConfig(dotFileInfo.filePath()); @@ -519,9 +519,9 @@ DirInfo TemplatesTreeView::readDirInfo(const QString& dir) } /** Writes a .dirinfo file from the selected item's path */ -bool TemplatesTreeView::writeDirInfo(const QString& m_dirInfoFile) +bool TemplatesTreeView::writeDirInfo(const TQString& m_dirInfoFile) { - QString startDir = ""; + TQString startDir = ""; if (m_dirInfoFile.isEmpty()) { @@ -537,7 +537,7 @@ bool TemplatesTreeView::writeDirInfo(const QString& m_dirInfoFile) startDir = m_dirInfoFile; } - QFileInfo dotFileInfo(QFileInfo(startDir).dirPath()+"/.dirinfo"); + TQFileInfo dotFileInfo(TQFileInfo(startDir).dirPath()+"/.dirinfo"); bool success = false; KConfig *config = new KConfig(dotFileInfo.filePath()); @@ -562,8 +562,8 @@ void TemplatesTreeView::slotProperties() KPropertiesDialog *propDlg = new KPropertiesDialog( url, this, 0L, false, false); //autodeletes itself //Always add the Quanta directory page - QFrame *quantaDirPage = propDlg->addPage(i18n("Quanta Template")); - QVBoxLayout *topLayout = new QVBoxLayout( quantaDirPage); + TQFrame *quantaDirPage = propDlg->addPage(i18n("Quanta Template")); + TQVBoxLayout *topLayout = new TQVBoxLayout( quantaDirPage); m_quantaProperties = new QuantaPropertiesPage( quantaDirPage, i18n("Quanta") ); m_quantaProperties->typesCombo->insertItem(typeToi18n["text/all"]); @@ -578,17 +578,17 @@ void TemplatesTreeView::slotProperties() KIO::UDSEntry entry; KIO::NetAccess::stat(url, entry, this); KFileItem fItem(entry, url); - QString permissions = fItem.permissionsString(); - QString userName; + TQString permissions = fItem.permissionsString(); + TQString userName; struct passwd *user = getpwuid(getuid()); if (user) - userName = QString::fromLocal8Bit(user->pw_name); - QString groupName; + userName = TQString::fromLocal8Bit(user->pw_name); + TQString groupName; gid_t gid = getgid(); struct group *ge = getgrgid(gid); if (ge) { - groupName = QString::fromLocal8Bit(ge->gr_name); + groupName = TQString::fromLocal8Bit(ge->gr_name); if (groupName.isEmpty()) groupName.sprintf("%d", ge->gr_gid); } else @@ -597,7 +597,7 @@ void TemplatesTreeView::slotProperties() if (permissions[8] == 'w' || (permissions[2] == 'w' && userName == fItem.user()) || (permissions[5] == 'w' && groupName == fItem.group())) writable = true; - QString startDir = ""; + TQString startDir = ""; if (!currentKFileTreeViewItem()->isDir()) { startDir = url.path(); @@ -608,7 +608,7 @@ void TemplatesTreeView::slotProperties() m_quantaProperties->typeStack->raiseWidget(0); } m_quantaProperties->setEnabled(writable); - QFileInfo dotFileInfo(QFileInfo(startDir).dirPath()+"/.dirinfo"); + TQFileInfo dotFileInfo(TQFileInfo(startDir).dirPath()+"/.dirinfo"); m_parentDirInfo = readDirInfo(dotFileInfo.dirPath()); if (!dotFileInfo.exists() || m_dirInfo.mimeType == m_parentDirInfo.mimeType) { @@ -629,9 +629,9 @@ void TemplatesTreeView::slotProperties() } topLayout->addWidget( m_quantaProperties ); - connect( propDlg, SIGNAL( applied() ), this , SLOT( slotPropertiesApplied()) ); + connect( propDlg, TQT_SIGNAL( applied() ), this , TQT_SLOT( slotPropertiesApplied()) ); - QString name = url.path() + TMPL; + TQString name = url.path() + TMPL; KConfig config(name); config.setGroup("Filtering"); name = config.readEntry("Action", NONE); @@ -640,7 +640,7 @@ void TemplatesTreeView::slotProperties() uint pos = 0; uint j = 1; m_quantaProperties->actionCombo->insertItem(i18n(NONE)); - QString tmpStr; + TQString tmpStr; KActionCollection *ac = m_mainWindow->actionCollection(); uint acCount = ac->count(); for (uint i = 0; i < acCount; i++) @@ -648,11 +648,11 @@ void TemplatesTreeView::slotProperties() TagAction *action = dynamic_cast<TagAction*>(ac->action(i)); if (action) { - QDomElement el = action->data(); - QString type = el.attribute("type", "tag"); + TQDomElement el = action->data(); + TQString type = el.attribute("type", "tag"); if (type == "script") { - tmpStr = action->text().replace(QRegExp("\\&(?!\\&)"),""); + tmpStr = action->text().replace(TQRegExp("\\&(?!\\&)"),""); m_quantaProperties->actionCombo->insertItem(tmpStr); if (tmpStr == name) pos = j; @@ -664,7 +664,7 @@ void TemplatesTreeView::slotProperties() //If the item is a file, add the Quanta file info page addFileInfoPage(propDlg); - if (propDlg->exec() == QDialog::Accepted) + if (propDlg->exec() == TQDialog::Accepted) { //TODO: move to slotPropertiesApplied if (url != propDlg->kurl()) @@ -679,7 +679,7 @@ void TemplatesTreeView::slotProperties() void TemplatesTreeView::slotPropertiesApplied() { DirInfo m_localDirInfo; - QString typeString = ""; + TQString typeString = ""; if (!m_quantaProperties->parentAttr->isChecked()) { @@ -721,7 +721,7 @@ void TemplatesTreeView::slotPropertiesApplied() writeTemplateInfo(); } -void TemplatesTreeView::updateTypeDescription(KFileTreeViewItem *item, const QString &typeString) +void TemplatesTreeView::updateTypeDescription(KFileTreeViewItem *item, const TQString &typeString) { if (item->parent() && item->isDir()) item->setText(1, typeString); @@ -733,7 +733,7 @@ void TemplatesTreeView::updateTypeDescription(KFileTreeViewItem *item, const QSt curItem->setText(1, typeString); } else { - QFileInfo dotFileInfo(curItem->url().path() + "/.dirinfo"); + TQFileInfo dotFileInfo(curItem->url().path() + "/.dirinfo"); if (!dotFileInfo.exists()) updateTypeDescription(curItem, typeString); } @@ -754,7 +754,7 @@ void TemplatesTreeView::slotInsertTag() /* Attention, this is called whenever a drop on a kate window happens! */ -void TemplatesTreeView::slotDragInsert(QDropEvent *e) +void TemplatesTreeView::slotDragInsert(TQDropEvent *e) { if (KURLDrag::canDecode(e)) { @@ -766,13 +766,13 @@ void TemplatesTreeView::slotDragInsert(QDropEvent *e) KURL url = fileList.front(); - QString localFileName; + TQString localFileName; if (url.isLocalFile()) { localFileName = url.path(); m_dirInfo = readDirInfo(localFileName); } - QString mimeType = KMimeType::findByURL(url)->name(); + TQString mimeType = KMimeType::findByURL(url)->name(); /* First, see if the type of the file is specified in the .dirinfo file */ if(m_dirInfo.mimeType.isEmpty()) @@ -807,15 +807,15 @@ void TemplatesTreeView::slotDragInsert(QDropEvent *e) } } } else - if (QTextDrag::canDecode(e)) + if (TQTextDrag::canDecode(e)) { - QString s; - QTextDrag::decode(e, s); + TQString s; + TQTextDrag::decode(e, s); KMessageBox::information(this,s, "Decode"); } } -void TemplatesTreeView::slotNewProjectLoaded(const QString &projectName, const KURL &baseURL, const KURL &templateURL) +void TemplatesTreeView::slotNewProjectLoaded(const TQString &projectName, const KURL &baseURL, const KURL &templateURL) { BaseTreeView::slotNewProjectLoaded(projectName, baseURL, templateURL); // set m_projectName and m_projectBaseURL if (m_projectDir) @@ -832,7 +832,7 @@ void TemplatesTreeView::slotNewProjectLoaded(const QString &projectName, const K */ void TemplatesTreeView::writeTemplateInfo() { - QString fileName = currentURL().path() + TMPL; + TQString fileName = currentURL().path() + TMPL; KConfig config(fileName); config.setGroup("Filtering"); if ( m_quantaProperties->actionCombo->currentText() == i18n(NONE) ) @@ -846,8 +846,8 @@ void TemplatesTreeView::slotPaste() { if (currentItem()) { - QClipboard *cb = QApplication::clipboard(); - KURL::List list( QStringList::split( QChar('\n'), cb->text() ) ); + QClipboard *cb = TQApplication::clipboard(); + KURL::List list( TQStringList::split( TQChar('\n'), cb->text() ) ); KURL url; uint j = list.count(); @@ -855,14 +855,14 @@ void TemplatesTreeView::slotPaste() { url = list[i]; url.setFileName(url.fileName() + TMPL); - if (url.isLocalFile() && QFileInfo(url.path()).exists()) + if (url.isLocalFile() && TQFileInfo(url.path()).exists()) list += url; } url = currentURL(); if ( ! currentKFileTreeViewItem()->isDir() ) url.setFileName(""); // don't paste on files but in dirs KIO::Job *job = KIO::copy( list, url); - connect( job, SIGNAL( result( KIO::Job *) ), this , SLOT( slotJobFinished( KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job *) ), this , TQT_SLOT( slotJobFinished( KIO::Job *) ) ); } } @@ -871,20 +871,20 @@ void TemplatesTreeView::slotDelete() if (currentItem()) { KURL url = currentURL(); - QString msg; + TQString msg; if ( currentKFileTreeViewItem()->isDir() ) msg = i18n("Do you really want to delete folder \n%1 ?\n").arg(url.path()); else msg = i18n("Do you really want to delete file \n%1 ?\n").arg(url.path()); - if ( KMessageBox::warningContinueCancel(this, msg, QString::null, KStdGuiItem::del()) == KMessageBox::Continue ) + if ( KMessageBox::warningContinueCancel(this, msg, TQString::null, KStdGuiItem::del()) == KMessageBox::Continue ) { KIO::Job *job = KIO::del(url); - connect( job, SIGNAL( result( KIO::Job *) ), this , SLOT( slotJobFinished( KIO::Job *) ) ); + connect( job, TQT_SIGNAL( result( KIO::Job *) ), this , TQT_SLOT( slotJobFinished( KIO::Job *) ) ); url.setFileName(url.fileName()+ TMPL); - if ( QFileInfo(url.path()).exists() ) { + if ( TQFileInfo(url.path()).exists() ) { KIO::Job *job2 = KIO::del(url); - connect( job2, SIGNAL( result( KIO::Job *) ), this , SLOT( slotJobFinished( KIO::Job *) ) ); + connect( job2, TQT_SIGNAL( result( KIO::Job *) ), this , TQT_SLOT( slotJobFinished( KIO::Job *) ) ); }; } } @@ -895,23 +895,23 @@ template file */ KURL TemplatesTreeView::filterTemplate() { KURL url = currentURL(); - QString name = url.path() + TMPL; + TQString name = url.path() + TMPL; KConfig config(name); config.setGroup("Filtering"); name = config.readEntry("Action", NONE); TagAction *filterAction = 0L; KActionCollection *ac = m_mainWindow->actionCollection(); uint acCount = ac->count(); - QString tmpStr; + TQString tmpStr; for (uint i = 0; i < acCount; i++) { TagAction *action = dynamic_cast<TagAction*>(ac->action(i)); if (action) { - QDomElement el = action->data(); - QString type = el.attribute("type", "tag"); + TQDomElement el = action->data(); + TQString type = el.attribute("type", "tag"); tmpStr = action->text(); - tmpStr.replace(QRegExp("\\&(?!\\&)"),""); + tmpStr.replace(TQRegExp("\\&(?!\\&)"),""); if (type == "script" && tmpStr == name) { filterAction = action; @@ -925,7 +925,7 @@ KURL TemplatesTreeView::filterTemplate() filterAction->setInputFileName(url.path()); filterAction->execute(true); filterAction->setOutputFile(0L); - filterAction->setInputFileName(QString::null); + filterAction->setInputFileName(TQString::null); tempFile->close(); tempFileList.append(tempFile); url.setPath(tempFile->name()); @@ -933,7 +933,7 @@ KURL TemplatesTreeView::filterTemplate() return url; } -QString TemplatesTreeView::createTemplateTarball() +TQString TemplatesTreeView::createTemplateTarball() { KURL url = currentURL(); KURL dirURL (url); @@ -943,7 +943,7 @@ QString TemplatesTreeView::createTemplateTarball() KTempDir* tempDir = new KTempDir(tmpDir); tempDir->setAutoDelete(true); tempDirList.append(tempDir); - QString tempFileName=tempDir->name() + url.fileName() + ".tgz"; + TQString tempFileName=tempDir->name() + url.fileName() + ".tgz"; //pack the files into a .tgz file KTar tar(tempFileName, "application/x-gzip"); tar.open(IO_WriteOnly); @@ -962,9 +962,9 @@ QString TemplatesTreeView::createTemplateTarball() if (!(*it_f).fileName(false).isEmpty()) { url = QExtFileInfo::toRelative( (*it_f), dirURL) ; - QFile file((*it_f).path()); + TQFile file((*it_f).path()); file.open(IO_ReadOnly); - QByteArray bArray = file.readAll(); + TQByteArray bArray = file.readAll(); tar.writeFile(url.path(), "user", "group", bArray.size(), bArray.data()); file.close(); }; @@ -979,19 +979,19 @@ void TemplatesTreeView::slotSendInMail() if ( ! currentKFileTreeViewItem() ) return; - QStringList attachmentFile; + TQStringList attachmentFile; attachmentFile += createTemplateTarball(); TagMailDlg *mailDlg = new TagMailDlg( this, i18n("Send template in email")); - QString toStr; - QString message = i18n("Hi,\n This is a Quanta Plus [http://quanta.kdewebdev.org] template tarball.\n\nHave fun.\n"); - QString titleStr; - QString subjectStr; + TQString toStr; + TQString message = i18n("Hi,\n This is a Quanta Plus [http://quanta.kdewebdev.org] template tarball.\n\nHave fun.\n"); + TQString titleStr; + TQString subjectStr; mailDlg->TitleLabel->setText(i18n("Content:")); /* mailDlg->titleEdit->setFixedHeight(60); - mailDlg->titleEdit->setVScrollBarMode(QTextEdit::Auto); - mailDlg->titleEdit->setHScrollBarMode(QTextEdit::Auto);*/ + mailDlg->titleEdit->setVScrollBarMode(TQTextEdit::Auto); + mailDlg->titleEdit->setHScrollBarMode(TQTextEdit::Auto);*/ if ( mailDlg->exec() ) { if ( !mailDlg->lineEmail->text().isEmpty()) @@ -1006,7 +1006,7 @@ void TemplatesTreeView::slotSendInMail() delete mailDlg; return; } - kapp->invokeMailer(toStr, QString::null, QString::null, subjectStr, message, QString::null, attachmentFile); + kapp->invokeMailer(toStr, TQString::null, TQString::null, subjectStr, message, TQString::null, attachmentFile); } delete mailDlg; } @@ -1017,16 +1017,16 @@ void TemplatesTreeView::slotUploadTemplate() emit uploadTemplate(createTemplateTarball()); } -bool TemplatesTreeView::acceptDrag(QDropEvent* e ) const +bool TemplatesTreeView::acceptDrag(TQDropEvent* e ) const { - return (BaseTreeView::acceptDrag(e) || QTextDrag::canDecode(e)); + return (BaseTreeView::acceptDrag(e) || TQTextDrag::canDecode(e)); } void TemplatesTreeView::slotExtractSiteTemplate() { - QString startDir = m_projectBaseURL.url(); + TQString startDir = m_projectBaseURL.url(); if (startDir.isEmpty()) - startDir = QDir::homeDirPath(); + startDir = TQDir::homeDirPath(); bool error = false; KURLRequesterDlg urlRequester(startDir, i18n("Target folder"), this, "req", true); urlRequester.urlRequester()->setMode(KFile::Directory); @@ -1034,7 +1034,7 @@ void TemplatesTreeView::slotExtractSiteTemplate() { KURL targetURL = urlRequester.selectedURL(); KURL url = currentURL(); - QString tempFile; + TQString tempFile; if (KIO::NetAccess::download(url, tempFile, this)) { KTar tar(tempFile); @@ -1047,11 +1047,11 @@ void TemplatesTreeView::slotExtractSiteTemplate() { KTempDir* tempDir = new KTempDir(tmpDir); tempDir->setAutoDelete(true); - QString tempDirName = tempDir->name(); + TQString tempDirName = tempDir->name(); directory->copyTo(tempDirName, true); - QStringList entries = directory->entries(); + TQStringList entries = directory->entries(); KURL::List fileList; - for (QStringList::Iterator it = entries.begin(); it != entries.end(); ++it) + for (TQStringList::Iterator it = entries.begin(); it != entries.end(); ++it) fileList.append(KURL::fromPathOrURL(tempDirName + "/" + *it)); if (!KIO::NetAccess::dircopy(fileList, targetURL, this)) error = true; @@ -1064,7 +1064,7 @@ void TemplatesTreeView::slotExtractSiteTemplate() KIO::NetAccess::removeTempFile(tempFile); if (!m_projectBaseURL.isEmpty() && !QExtFileInfo::toRelative(targetURL, m_projectBaseURL).url().startsWith(".")) { - if (KMessageBox::questionYesNo(this, i18n("You have extracted the site template to a folder which is not under your main project folder.\nDo you want to copy the folder into the main project folder?"), QString::null, i18n("Copy Folder"), i18n("Do Not Copy")) == KMessageBox::Yes) + if (KMessageBox::questionYesNo(this, i18n("You have extracted the site template to a folder which is not under your main project folder.\nDo you want to copy the folder into the main project folder?"), TQString::null, i18n("Copy Folder"), i18n("Do Not Copy")) == KMessageBox::Yes) { emit insertDirInProject(targetURL); } |