diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 19:59:21 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 19:59:21 +0000 |
commit | b9c374725620ec064db7610132a8b8969fa405b9 (patch) | |
tree | 645c03144cac22f7b4fb5bd10985d389e8954290 /src/kile/userhelp.cpp | |
parent | 71729070d61b36b96acd7fa9c34bba0cb8f58c3b (diff) | |
download | kile-b9c374725620ec064db7610132a8b8969fa405b9.tar.gz kile-b9c374725620ec064db7610132a8b8969fa405b9.zip |
TQt4 port kile
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kile@1239285 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kile/userhelp.cpp')
-rw-r--r-- | src/kile/userhelp.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/kile/userhelp.cpp b/src/kile/userhelp.cpp index 3d847e5..23b8a4b 100644 --- a/src/kile/userhelp.cpp +++ b/src/kile/userhelp.cpp @@ -18,7 +18,7 @@ #include "userhelp.h" -#include <qfileinfo.h> +#include <tqfileinfo.h> #include <kglobal.h> #include <kiconloader.h> @@ -51,7 +51,7 @@ UserHelp::~UserHelp() void UserHelp::readConfig() { //KILE_DEBUG() << "\tuserhelp: read config" << endl; - QStringList menu,files; + TQStringList menu,files; // first read all entries KConfig *config = m_manager->config(); @@ -59,11 +59,11 @@ void UserHelp::readConfig() int entries = config->readNumEntry("entries"); for ( int i=0; i<entries; ++i ) { - menu << config->readEntry(QString("menu%1").arg(i)); + menu << config->readEntry(TQString("menu%1").tqarg(i)); if ( !menu[i].isEmpty() || menu[i]=="-" ) - files << config->readEntry(QString("file%1").arg(i)); + files << config->readEntry(TQString("file%1").tqarg(i)); else - files << QString::null; + files << TQString(); } // then update menu @@ -84,9 +84,9 @@ void UserHelp::writeConfig() config->writeEntry("entries",entries); for ( int i=0; i<entries; ++i ) { - config->writeEntry(QString("menu%1").arg(i), m_menuentries[i]); + config->writeEntry(TQString("menu%1").tqarg(i), m_menuentries[i]); if ( m_menuentries[i] != "-" ) - config->writeEntry(QString("file%1").arg(i), m_helpfiles[i]); + config->writeEntry(TQString("file%1").tqarg(i), m_helpfiles[i]); } } @@ -101,7 +101,7 @@ void UserHelp::expandHelpMenu() { int helpindex = getHelpIndex(m_helpmenu); - m_helppopup = new QPopupMenu(); + m_helppopup = new TQPopupMenu(); if ( m_helppopup ) { m_sepid = m_helpmenu->insertSeparator(helpindex); @@ -114,7 +114,7 @@ void UserHelp::expandHelpMenu() // update stringlists and userhelp menu -void UserHelp::updateEntries(const QStringList &entries, const QStringList &files, bool save) +void UserHelp::updateEntries(const TQStringList &entries, const TQStringList &files, bool save) { if ( m_menuentries==entries && m_helpfiles==files) return; @@ -157,26 +157,26 @@ void UserHelp::setupUserHelpMenu() else { // check for a http file - bool http = ( m_helpfiles[i].find("http://",0) == 0 ); + bool http = ( m_helpfiles[i].tqfind("http://",0) == 0 ); // some file types have an icon - QFileInfo fi(m_helpfiles[i]); - QString ext = fi.extension(false); + TQFileInfo fi(m_helpfiles[i]); + TQString ext = fi.extension(false); if ( ext == "htm" ) ext = "html"; if ( http || ext=="html" || ext=="dvi" || ext=="ps" || ext=="pdf" ) { - QString icon = ( http ) ? "viewhtml" : ext; + TQString icon = ( http ) ? "viewhtml" : ext; helpid = m_helppopup->insertItem( SmallIcon(icon),m_menuentries[i], - this,SLOT(slotUserHelpActivated(int)) ); + this,TQT_SLOT(slotUserHelpActivated(int)) ); } else { helpid = m_helppopup->insertItem( m_menuentries[i], - this,SLOT(slotUserHelpActivated(int)) ); + this,TQT_SLOT(slotUserHelpActivated(int)) ); } - // send index of QStringList as parameter, when the slot is activated + // send index of TQStringList as parameter, when the slot is activated m_helppopup->setItemParameter(helpid,i); } } @@ -196,14 +196,14 @@ void UserHelp::enableUserHelpEntries(bool state) } } -QPopupMenu *UserHelp::getHelpPopup() +TQPopupMenu *UserHelp::getHelpPopup() { int helpid = 0; for (uint i=0; i<m_menubar->count(); ++i) { int id = m_menubar->idAt(i); - QString text = m_menubar->text(id); + TQString text = m_menubar->text(id); if ( text == i18n("&Help") ) { @@ -211,10 +211,10 @@ QPopupMenu *UserHelp::getHelpPopup() break; } } - return ( helpid == 0 ) ? 0 : m_menubar->findItem(helpid)->popup(); + return ( helpid == 0 ) ? 0 : m_menubar->tqfindItem(helpid)->popup(); } -int UserHelp::getHelpIndex(QPopupMenu *popup) +int UserHelp::getHelpIndex(TQPopupMenu *popup) { if ( popup ) { @@ -222,7 +222,7 @@ int UserHelp::getHelpIndex(QPopupMenu *popup) for (uint i=0; i<popup->count(); ++i) { int entryid = popup->idAt(i); - QString entry = popup->text(entryid); + TQString entry = popup->text(entryid); if ( entry.isEmpty() ) { @@ -242,14 +242,14 @@ void UserHelp::slotUserHelpActivated(int index) return; // get filename of this user help entry - QString filename = m_helpfiles[index]; + TQString filename = m_helpfiles[index]; // does the files exist? - QFileInfo fi(filename); - bool http = ( filename.find("http://",0) == 0 ); + TQFileInfo fi(filename); + bool http = ( filename.tqfind("http://",0) == 0 ); if ( !http && !fi.exists() ) { - KMessageBox::error(0,QString(i18n("File '%1' doesn't exist.")).arg(filename)); + KMessageBox::error(0,TQString(i18n("File '%1' doesn't exist.")).tqarg(filename)); return; } @@ -257,11 +257,11 @@ void UserHelp::slotUserHelpActivated(int index) KILE_DEBUG() << "\tshow userhelpfile (" << filename << ")" << endl; // determine, how to show the file - QString type; - QString cfg = "Embedded Viewer"; + TQString type; + TQString cfg = "Embedded Viewer"; if ( !http && KileConfig::embedded()==0 ) { - QString ext = fi.extension(false); + TQString ext = fi.extension(false); if ( ext == "dvi" ) type = "ViewDVI"; else if ( ext == "ps" ) @@ -273,7 +273,7 @@ void UserHelp::slotUserHelpActivated(int index) } KConfig *config = m_manager->config(); - if ( type!=QString::null && config->hasGroup("Tool/" + type + '/' + cfg) ) + if ( type!=TQString() && config->hasGroup("Tool/" + type + '/' + cfg) ) { KileTool::View *tool = new KileTool::View(type, m_manager, false); tool->setFlags(0); @@ -292,7 +292,7 @@ void UserHelp::slotUserHelpActivated(int index) void UserHelp::userHelpDialog() { - QStringList userhelpmenulist, userhelpfilelist; + TQStringList userhelpmenulist, userhelpfilelist; KileDialog::UserHelpDialog *dialog = new KileDialog::UserHelpDialog(); dialog->setParameter(m_menuentries,m_helpfiles); |