diff options
Diffstat (limited to 'krusader/UserAction')
-rw-r--r-- | krusader/UserAction/expander.cpp | 296 | ||||
-rw-r--r-- | krusader/UserAction/expander.h | 72 | ||||
-rw-r--r-- | krusader/UserAction/kraction.cpp | 170 | ||||
-rw-r--r-- | krusader/UserAction/kraction.h | 91 | ||||
-rw-r--r-- | krusader/UserAction/kractionbase.cpp | 10 | ||||
-rw-r--r-- | krusader/UserAction/kractionbase.h | 10 | ||||
-rw-r--r-- | krusader/UserAction/tstring.h | 22 | ||||
-rw-r--r-- | krusader/UserAction/useraction.cpp | 60 | ||||
-rw-r--r-- | krusader/UserAction/useraction.h | 28 | ||||
-rw-r--r-- | krusader/UserAction/useractionpopupmenu.cpp | 2 | ||||
-rw-r--r-- | krusader/UserAction/useractionpopupmenu.h | 2 |
11 files changed, 383 insertions, 380 deletions
diff --git a/krusader/UserAction/expander.cpp b/krusader/UserAction/expander.cpp index e18cfe2..fc4aab9 100644 --- a/krusader/UserAction/expander.cpp +++ b/krusader/UserAction/expander.cpp @@ -36,41 +36,41 @@ #include <kstandarddirs.h> #include <kmessagebox.h> #include <ktempfile.h> -#include <qstringlist.h> -#include <qclipboard.h> +#include <tqstringlist.h> +#include <tqclipboard.h> #include <functional> using namespace std; -#define NEED_PANEL if (panel==0) { panelMissingError(_expression,exp); return QString::null; } +#define NEED_PANEL if (panel==0) { panelMissingError(_expression,exp); return TQString(); } #include "tstring.h" -QValueList<const exp_placeholder*>& Expander::_placeholder() +TQValueList<const exp_placeholder*>& Expander::_placeholder() { - static QValueList<const exp_placeholder*> ret; + static TQValueList<const exp_placeholder*> ret; return ret; } -void exp_placeholder::panelMissingError(const QString &s, Expander& exp) +void exp_placeholder::panelMissingError(const TQString &s, Expander& exp) { - exp.setError( Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Needed panel specification missing in expander %1").arg(s)) ); + exp.setError( Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Needed panel specification missing in expander %1").tqarg(s)) ); } -QStringList exp_placeholder::fileList(const ListPanel* const panel,const QString& type,const QString& mask,const bool ommitPath,const bool useUrl,Expander& exp,const QString& error) +TQStringList exp_placeholder::fileList(const ListPanel* const panel,const TQString& type,const TQString& tqmask,const bool ommitPath,const bool useUrl,Expander& exp,const TQString& error) { - QStringList items; + TQStringList items; if ( type.isEmpty() || type == "all" ) - panel->view->getItemsByMask( mask, &items ); + panel->view->getItemsByMask( tqmask, &items ); else if ( type == "files" ) - panel->view->getItemsByMask( mask, &items, false, true ); + panel->view->getItemsByMask( tqmask, &items, false, true ); else if ( type == "dirs" ) - panel->view->getItemsByMask( mask, &items, true, false ); + panel->view->getItemsByMask( tqmask, &items, true, false ); else if ( type == "selected" ) panel->view->getSelectedItems( &items ); else { - setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: Bad argument to %1: %2 is not valid item specifier").arg(error,type) ) ); - return QString::null; + setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: Bad argument to %1: %2 is not valid item specifier").tqarg(error,type) ) ); + return TQString(); } if ( !ommitPath ) { // add the current path // translate to urls using vfs @@ -92,7 +92,7 @@ class exp_simpleplaceholder : public exp_placeholder { public: EXP_FUNC; - virtual TagString expFunc ( const ListPanel*, const QStringList&, const bool&, Expander& ) const=0; + virtual TagString expFunc ( const ListPanel*, const TQStringList&, const bool&, Expander& ) const=0; }; /** @@ -176,7 +176,7 @@ public: }; /** - * This selects all items by the mask given with the first Parameter + * This selects all items by the tqmask given with the first Parameter */ class exp_Select : public exp_simpleplaceholder { static const exp_Select instance; @@ -329,22 +329,22 @@ const exp_Path exp_Path::instance; * @param s String to manipulate * @return escaped string */ -QString bashquote( QString s ) { +TQString bashquote( TQString s ) { /* // we _can_not_ use this function because it _encloses_ the sting in single-quots! // In this case quotes strings could not be concaternated anymore return KrServices::quote(s); */ - static const QString evilstuff = "\\\"'`()[]{}!?;$&<>| \t\r\n"; // stuff that should get escaped + static const TQString evilstuff = "\\\"'`()[]{}!?;$&<>| \t\r\n"; // stuff that should get escaped for ( unsigned int i = 0; i < evilstuff.length(); ++i ) - s.replace( evilstuff[ i ], ('\\' + evilstuff[ i ]) ); + s.tqreplace( evilstuff[ i ], (TQString('\\') + evilstuff[ i ]) ); return s; } -QString separateAndQuote(QStringList list,const QString& separator,const bool quote) +TQString separateAndQuote(TQStringList list,const TQString& separator,const bool quote) { if(quote) transform(list.begin(),list.end(),list.begin(),bashquote); @@ -361,10 +361,10 @@ exp_Path::exp_Path() { addParameter( exp_parameter( i18n("Automatically escape spaces"), "__yes", false ) ); } -TagString exp_Path::expFunc( const ListPanel* panel, const QStringList& parameter, const bool& useUrl, Expander& exp ) const { +TagString exp_Path::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool& useUrl, Expander& exp ) const { NEED_PANEL - QString result; + TQString result; if ( useUrl ) result = panel->func->files()->vfs_getOrigin().url() + "/"; @@ -384,7 +384,7 @@ exp_Count::exp_Count() { addParameter( exp_parameter( i18n("Count:"), "__choose:All;Files;Dirs;Selected", false ) ); } -TagString exp_Count::expFunc( const ListPanel* panel, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_Count::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool&, Expander& exp ) const { NEED_PANEL int n = -1; @@ -397,11 +397,11 @@ TagString exp_Count::expFunc( const ListPanel* panel, const QStringList& paramet else if ( parameter[ 0 ].lower() == "selected" ) n = panel->view->numSelected(); else { - setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: Bad argument to Count: %1 is not valid item specifier").arg(parameter[0]) )); - return QString::null; + setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: Bad argument to Count: %1 is not valid item specifier").tqarg(parameter[0]) )); + return TQString(); } - return TagString(QString("%1").arg( n )); + return TagString(TQString("%1").tqarg( n )); } exp_Filter::exp_Filter() { @@ -409,7 +409,7 @@ exp_Filter::exp_Filter() { _description = i18n("Filter Mask (*.h, *.cpp, etc.)"); _needPanel = true; } -TagString exp_Filter::expFunc( const ListPanel* panel, const QStringList&, const bool&, Expander& exp ) const { +TagString exp_Filter::expFunc( const ListPanel* panel, const TQStringList&, const bool&, Expander& exp ) const { NEED_PANEL return panel->view->filterMask().nameFilter(); @@ -423,12 +423,12 @@ exp_Current::exp_Current() { addParameter( exp_parameter( i18n("Omit the current path (optional)"), "__no", false ) ); addParameter( exp_parameter( i18n("Automatically escape spaces"), "__yes", false ) ); } -TagString exp_Current::expFunc( const ListPanel* panel, const QStringList& parameter, const bool& useUrl, Expander& exp ) const { +TagString exp_Current::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool& useUrl, Expander& exp ) const { NEED_PANEL - QString item = panel->view->getCurrentItem(); + TQString item = panel->view->getCurrentItem(); - QString result; + TQString result; if ( parameter[0].lower() == "yes" ) // ommit the current path result = item; @@ -457,22 +457,22 @@ exp_List::exp_List() { addParameter( exp_parameter( i18n("Mask (optional, all but 'Selected'):"), "__select", false ) ); addParameter( exp_parameter( i18n("Automatically escape spaces"), "__yes", false ) ); } -TagString exp_List::expFunc( const ListPanel* panel, const QStringList& parameter, const bool& useUrl, Expander& exp ) const { +TagString exp_List::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool& useUrl, Expander& exp ) const { NEED_PANEL // get selected items from view - QStringList items; - QString mask; + TQStringList items; + TQString tqmask; if ( parameter.count() <= 3 || parameter[3].isEmpty() ) - mask = "*"; + tqmask = "*"; else - mask = parameter[3]; + tqmask = parameter[3]; return separateAndQuote( fileList(panel, - parameter.empty() ? QString::null : parameter[0].lower(), - mask, parameter.count() > 2 ? parameter[2].lower()=="yes" : false, + parameter.empty() ? TQString() : parameter[0].lower(), + tqmask, parameter.count() > 2 ? parameter[2].lower()=="yes" : false, useUrl, exp, "List"), parameter.count() > 1 ? parameter[1] : " ", parameter.count() > 4 ? parameter[4].lower()=="yes" : true); @@ -489,29 +489,29 @@ exp_ListFile::exp_ListFile() { addParameter( exp_parameter( i18n("Mask (optional, all but 'Selected'):"), "__select", false ) ); addParameter( exp_parameter( i18n("Automatically escape spaces"), "__no", false ) ); } -TagString exp_ListFile::expFunc( const ListPanel* panel, const QStringList& parameter, const bool& useUrl, Expander& exp ) const { +TagString exp_ListFile::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool& useUrl, Expander& exp ) const { NEED_PANEL // get selected items from view - QStringList items; - QString mask; + TQStringList items; + TQString tqmask; if ( parameter.count() <= 3 || parameter[3].isEmpty() ) - mask = "*"; + tqmask = "*"; else - mask = parameter[3]; + tqmask = parameter[3]; KTempFile tmpFile( locateLocal("tmp", "krusader"), ".itemlist" ); if ( tmpFile.status() != 0 ) { - setError(exp, Error(Error::S_FATAL,Error::C_WORLD, i18n("Expander: tempfile couldn't be opened (%1)" ).arg(strerror( tmpFile.status() )) )); - return QString::null; + setError(exp, Error(Error::S_FATAL,Error::C_WORLD, i18n("Expander: tempfile couldn't be opened (%1)" ).tqarg(strerror( tmpFile.status() )) )); + return TQString(); } - QTextStream stream( tmpFile.file() ); + TQTextStream stream( tmpFile.file() ); stream << separateAndQuote( fileList(panel, - parameter.empty() ? QString::null : parameter[0].lower(), - mask, parameter.count()>2 ? parameter[2].lower()=="yes" : false, + parameter.empty() ? TQString() : parameter[0].lower(), + tqmask, parameter.count()>2 ? parameter[2].lower()=="yes" : false, useUrl, exp, "ListFile"), parameter.count() > 1 ? parameter[1] : "\n", parameter.count() > 4 ? parameter[4].lower()=="yes" : true) @@ -526,28 +526,28 @@ exp_Select::exp_Select() { _description = i18n("Manipulate the Selection..."); _needPanel = true; - addParameter( exp_parameter( i18n("Selection mask:"), "__select", true ) ); + addParameter( exp_parameter( i18n("Selection tqmask:"), "__select", true ) ); addParameter( exp_parameter( i18n("Manipulate in which way:"), "__choose:Set;Add;Remove", false ) ); } -TagString exp_Select::expFunc( const ListPanel* panel, const QStringList& parameter, const bool& , Expander& exp) const { +TagString exp_Select::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool& , Expander& exp) const { NEED_PANEL - KRQuery mask; + KRQuery tqmask; if ( parameter.count() <= 0 || parameter[0].isEmpty() ) - mask = KRQuery( "*" ); + tqmask = KRQuery( "*" ); else - mask = KRQuery( parameter[0] ); + tqmask = KRQuery( parameter[0] ); if ( parameter[1].lower() == "add") - panel->view->select( mask ); + panel->view->select( tqmask ); else if ( parameter[1].lower() == "remove") - panel->view->unselect( mask ); + panel->view->unselect( tqmask ); else { // parameter[1].lower() == "set" or isEmpty() or whatever panel->view->unselect( KRQuery( "*" ) ); - panel->view->select( mask ); + panel->view->select( tqmask ); } - return QString::null; // this doesn't return anything, that's normal! + return TQString(); // this doesn't return anything, that's normal! } exp_Goto::exp_Goto() { @@ -558,7 +558,7 @@ exp_Goto::exp_Goto() { addParameter( exp_parameter( i18n("Choose a path:"), "__goto", true ) ); addParameter( exp_parameter( i18n("Open location in a new tab"), "__no", false ) ); } -TagString exp_Goto::expFunc( const ListPanel* panel, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_Goto::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool&, Expander& exp ) const { NEED_PANEL bool newTab = false; @@ -576,7 +576,7 @@ TagString exp_Goto::expFunc( const ListPanel* panel, const QStringList& paramete const_cast<ListPanel*>(panel)->slotFocusOnMe(); } - return QString::null; // this doesn't return anything, that's normal! + return TQString(); // this doesn't return anything, that's normal! } /* @@ -599,15 +599,15 @@ exp_Ask::exp_Ask() { addParameter( exp_parameter( i18n("Preset (optional):"), "", false ) ); addParameter( exp_parameter( i18n("Caption (optional):"), "", false ) ); } -TagString exp_Ask::expFunc( const ListPanel*, const QStringList& parameter, const bool&, Expander& exp ) const { - QString caption, preset, result; +TagString exp_Ask::expFunc( const ListPanel*, const TQStringList& parameter, const bool&, Expander& exp ) const { + TQString caption, preset, result; if ( parameter.count() <= 2 || parameter[2].isEmpty() ) caption = i18n("User Action"); else caption = parameter[2]; if ( parameter.count() <= 1 || parameter[1].isEmpty() ) - preset = QString::null; + preset = TQString(); else preset = parameter[1]; @@ -622,7 +622,7 @@ TagString exp_Ask::expFunc( const ListPanel*, const QStringList& parameter, cons return result; else { setError(exp, Error(Error::S_ERROR,Error::C_USER,"User cancelled") ); - return QString::null; + return TQString(); } } @@ -635,18 +635,18 @@ exp_Clipboard::exp_Clipboard() { addParameter( exp_parameter( i18n("Append to current clipboard content with this separator (optional):"), "", false ) ); } TagString exp_Clipboard::expFunc( const ListPanel*, const TagStringList& parameter, const bool&, Expander& exp ) const { -// kdDebug() << "Expander::exp_Clipboard, parameter[0]: '" << parameter[0] << "', Clipboard: " << KApplication::clipboard()->text() << endl; - QStringList lst=splitEach(parameter[0]); +// kdDebug() << "Expander::exp_Clipboard, parameter[0]: '" << parameter[0] << "', Clipboard: " << KApplication::tqclipboard()->text() << endl; + TQStringList lst=splitEach(parameter[0]); if(!parameter[1].isSimple()) { setError(exp,Error(Error::S_FATAL,Error::C_SYNTAX,i18n("Expander: %Each% may not be in the second argument of %Clipboard%"))); - return QString::null; + return TQString(); } - if ( parameter.count() <= 1 || parameter[1].string().isEmpty() || KApplication::clipboard()->text().isEmpty() ) - KApplication::clipboard()->setText( lst.join("\n") ); + if ( parameter.count() <= 1 || parameter[1].string().isEmpty() || KApplication::tqclipboard()->text().isEmpty() ) + KApplication::tqclipboard()->setText( lst.join("\n") ); else - KApplication::clipboard()->setText( KApplication::clipboard()->text() + parameter[1].string() + lst.join("\n") ); + KApplication::tqclipboard()->setText( KApplication::tqclipboard()->text() + parameter[1].string() + lst.join("\n") ); - return QString::null; // this doesn't return anything, that's normal! + return TQString(); // this doesn't return anything, that's normal! } exp_Copy::exp_Copy() { @@ -660,25 +660,25 @@ exp_Copy::exp_Copy() { TagString exp_Copy::expFunc( const ListPanel*, const TagStringList& parameter, const bool&, Expander& exp ) const { // basically the parameter can already be used as URL, but since KURL has problems with ftp-proxy-urls (like ftp://username@proxyusername@url...) this is neccesary: - QStringList lst=splitEach( parameter[0] ); + TQStringList lst=splitEach( parameter[0] ); if(!parameter[1].isSimple()) { setError(exp,Error(Error::S_FATAL,Error::C_SYNTAX,i18n("Expander: %Each% may not be in the second argument of %Copy%"))); - return QString::null; + return TQString(); } KURL::List src; - for(QStringList::const_iterator it=lst.begin(),end=lst.end();it!=end;++it) + for(TQStringList::const_iterator it=lst.begin(),end=lst.end();it!=end;++it) src.push_back(vfs::fromPathOrURL( *it )); // or transform(...) ? KURL dest = vfs::fromPathOrURL( parameter[1].string() ); if ( !dest.isValid() || find_if(src.constBegin(),src.constEnd(),not1(mem_fun_ref(&KURL::isValid) ))!=src.end()) { setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: invalid URL's in %_Copy(\"src\", \"dest\")%") )); - return QString::null; + return TQString(); } PreservingCopyJob::createCopyJob( PM_DEFAULT, src, dest, KIO::CopyJob::Copy, false, true ); - return QString::null; // this doesn't return everything, that's normal! + return TQString(); // this doesn't return everything, that's normal! } exp_Move::exp_Move() { @@ -691,25 +691,25 @@ exp_Move::exp_Move() { } TagString exp_Move::expFunc( const ListPanel*, const TagStringList& parameter, const bool& , Expander& exp ) const { // basically the parameter can already be used as URL, but since KURL has problems with ftp-proxy-urls (like ftp://username@proxyusername@url...) this is neccesary: - QStringList lst=splitEach( parameter[0] ); + TQStringList lst=splitEach( parameter[0] ); if(!parameter[1].isSimple()) { setError(exp,Error(Error::S_FATAL,Error::C_SYNTAX,i18n("%Each% may not be in the second argument of %Move%"))); - return QString::null; + return TQString(); } KURL::List src; - for(QStringList::const_iterator it=lst.begin(),end=lst.end();it!=end;++it) + for(TQStringList::const_iterator it=lst.begin(),end=lst.end();it!=end;++it) src.push_back(vfs::fromPathOrURL( *it )); // or transform(...) ? KURL dest = vfs::fromPathOrURL( parameter[1].string() ); if ( !dest.isValid() || find_if(src.constBegin(),src.constEnd(),not1(mem_fun_ref(&KURL::isValid) ))!=src.end()) { setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: invalid URL's in %_Move(\"src\", \"dest\")%") )); - return QString::null; + return TQString(); } PreservingCopyJob::createCopyJob( PM_DEFAULT, src, dest, KIO::CopyJob::Move, false, true ); - return QString::null; // this doesn't return anything, that's normal! + return TQString(); // this doesn't return anything, that's normal! } exp_Sync::exp_Sync() { @@ -719,15 +719,15 @@ exp_Sync::exp_Sync() { addParameter( exp_parameter( i18n("Choose a profile:"), "__syncprofile", true ) ); } -TagString exp_Sync::expFunc( const ListPanel*, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_Sync::expFunc( const ListPanel*, const TQStringList& parameter, const bool&, Expander& exp ) const { if ( parameter[0].isEmpty() ) { setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: no profile specified for %_Sync(profile)%") )); - return QString::null; + return TQString(); } new SynchronizerGUI( 0, parameter[0] ); - return QString::null; // this doesn't return everything, that's normal! + return TQString(); // this doesn't return everything, that's normal! } exp_NewSearch::exp_NewSearch() { @@ -737,15 +737,15 @@ exp_NewSearch::exp_NewSearch() { addParameter( exp_parameter( i18n("Choose a profile:"), "__searchprofile", true ) ); } -TagString exp_NewSearch::expFunc( const ListPanel*, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_NewSearch::expFunc( const ListPanel*, const TQStringList& parameter, const bool&, Expander& exp ) const { if ( parameter[0].isEmpty() ) { setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: no profile specified for %_NewSearch(profile)%") )); - return QString::null; + return TQString(); } new KrSearchDialog( parameter[0], krApp ); - return QString::null; // this doesn't return everything, that's normal! + return TQString(); // this doesn't return everything, that's normal! } exp_Profile::exp_Profile() { @@ -755,15 +755,15 @@ exp_Profile::exp_Profile() { addParameter( exp_parameter( i18n("Choose a profile:"), "__panelprofile", true ) ); } -TagString exp_Profile::expFunc( const ListPanel*, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_Profile::expFunc( const ListPanel*, const TQStringList& parameter, const bool&, Expander& exp ) const { if ( parameter[0].isEmpty() ) { setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: no profile specified for %_Profile(profile)%; abort...") )); - return QString::null; + return TQString(); } MAIN_VIEW->profiles( parameter[0] ); - return QString::null; // this doesn't return everything, that's normal! + return TQString(); // this doesn't return everything, that's normal! } exp_Each::exp_Each() { @@ -776,19 +776,19 @@ exp_Each::exp_Each() { addParameter( exp_parameter( i18n("Mask (optional, all but 'Selected'):"), "__select", false ) ); addParameter( exp_parameter( i18n("Automatically escape spaces"), "__yes", false ) ); } -TagString exp_Each::expFunc( const ListPanel* panel, const QStringList& parameter, const bool& useUrl, Expander& exp ) const { +TagString exp_Each::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool& useUrl, Expander& exp ) const { NEED_PANEL - QString mask; + TQString tqmask; if ( parameter.count() <= 2 || parameter[2].isEmpty() ) - mask = "*"; + tqmask = "*"; else - mask = parameter[2]; + tqmask = parameter[2]; TagString ret; - QStringList l = fileList(panel, - parameter.empty() ? QString::null : parameter[0].lower(), - mask, parameter.count() > 1 && parameter[1].lower()=="yes", + TQStringList l = fileList(panel, + parameter.empty() ? TQString() : parameter[0].lower(), + tqmask, parameter.count() > 1 && parameter[1].lower()=="yes", useUrl, exp, "Each"); if(!(parameter.count()<=3 || parameter[3].lower()!="yes")) @@ -806,12 +806,12 @@ exp_ColSort::exp_ColSort() { addParameter( exp_parameter( i18n("Choose a column:"), "__choose:Name;Ext;Type;Size;Modified;Perms;rwx;Owner;Group", true ) ); addParameter( exp_parameter( i18n("Choose a sort sequence:"), "__choose:Toggle;Asc;Desc", false ) ); } -TagString exp_ColSort::expFunc( const ListPanel* panel, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_ColSort::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool&, Expander& exp ) const { NEED_PANEL if ( parameter[0].isEmpty() ) { setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: no column specified for %_ColSort(column)%") )); - return QString::null; + return TQString(); } int mode = (int) panel->view->sortMode(); @@ -832,7 +832,7 @@ TagString exp_ColSort::expFunc( const ListPanel* panel, const QStringList& param */ // krOut << "start: exp_ColSort::expFunc" << endl; - #define MODE_OUT krOut << QString( "mode: %1" ).arg( mode, 0, 2 ) << endl; // displays mode in base-2 + #define MODE_OUT krOut << TQString( "mode: %1" ).tqarg( mode, 0, 2 ) << endl; // displays mode in base-2 //MODE_OUT if ( parameter.count() <= 1 || ( parameter[1].lower() != "asc" && parameter[1].lower() != "desc" ) ) { //default == toggle @@ -882,14 +882,14 @@ TagString exp_ColSort::expFunc( const ListPanel* panel, const QStringList& param if ( parameter[0].lower() == "group" ) { mode |= KrViewProperties::Group; } else { - setError(exp, Error(Error::S_WARNING,Error::C_ARGUMENT,i18n("Expander: unknown column specified for %_ColSort(%1)%").arg(parameter[0]) )); - return QString::null; + setError(exp, Error(Error::S_WARNING,Error::C_ARGUMENT,i18n("Expander: unknown column specified for %_ColSort(%1)%").tqarg(parameter[0]) )); + return TQString(); } //MODE_OUT panel->view->setSortMode( (KrViewProperties::SortSpec)mode ); // krOut << "end: exp_ColSort::expFunc" << endl; - return QString::null; // this doesn't return anything, that's normal! + return TQString(); // this doesn't return anything, that's normal! } exp_PanelSize::exp_PanelSize() { @@ -899,7 +899,7 @@ exp_PanelSize::exp_PanelSize() { addParameter( exp_parameter( i18n("Set the new size in percent:"), "__int:0;100;5;50", true ) ); } -TagString exp_PanelSize::expFunc( const ListPanel* panel, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_PanelSize::expFunc( const ListPanel* panel, const TQStringList& parameter, const bool&, Expander& exp ) const { NEED_PANEL int newSize; @@ -909,11 +909,11 @@ TagString exp_PanelSize::expFunc( const ListPanel* panel, const QStringList& par newSize = parameter[0].toInt(); if ( newSize < 0 || newSize > 100 ) { - setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: Value %1 out of range for %_PanelSize(percent)%. The first parameter has to be >0 and <100").arg(newSize)) ); - return QString::null; + setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: Value %1 out of range for %_PanelSize(percent)%. The first parameter has to be >0 and <100").tqarg(newSize)) ); + return TQString(); } - QValueList<int> panelSizes = MAIN_VIEW->horiz_splitter->sizes(); + TQValueList<int> panelSizes = MAIN_VIEW->horiz_splitter->sizes(); int totalSize = panelSizes[0] + panelSizes[1]; if ( panel == LEFT_PANEL ) { @@ -927,7 +927,7 @@ TagString exp_PanelSize::expFunc( const ListPanel* panel, const QStringList& par MAIN_VIEW->horiz_splitter->setSizes( panelSizes ); - return QString::null; // this doesn't return everything, that's normal! + return TQString(); // this doesn't return everything, that's normal! } #ifdef __KJSEMBED__ @@ -939,14 +939,14 @@ exp_Script::exp_Script() { addParameter( exp_parameter( i18n("Location of the script"), "", true ) ); addParameter( exp_parameter( i18n("Set some variables for the execution (optional).\ni.e. \"return=return_var;foo=bar\", consult the handbook for more information"), "", false ) ); } -TagString exp_Script::expFunc( const ListPanel*, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_Script::expFunc( const ListPanel*, const TQStringList& parameter, const bool&, Expander& exp ) const { if ( parameter[0].isEmpty() ) { setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: no script specified for %_Script(script)%")) ); - return QString::null; + return TQString(); } - QString filename = parameter[0]; - if ( filename.find('/') && KURL::isRelativeURL(filename) ) { + TQString filename = parameter[0]; + if ( filename.tqfind('/') && KURL::isRelativeURL(filename) ) { // this return the local version of the file if this exists. else the global one is returnd filename = locate( "data", "krusader/js/"+filename ); } @@ -956,13 +956,13 @@ TagString exp_Script::expFunc( const ListPanel*, const QStringList& parameter, c KJS::ExecState *exec = krJS->globalExec(); - QString jsReturn = QString::null; + TQString jsReturn = TQString(); if ( parameter[1].lower() == "yes" ) // to stay compatible with the old-style parameter jsReturn = "cmd"; else { - QStringList jsVariables = QStringList::split( ';', parameter[1] ); - QString jsVariable, jsValue; - for ( QStringList::Iterator it = jsVariables.begin(); it != jsVariables.end(); ++it ) { + TQStringList jsVariables = TQStringList::split( ';', parameter[1] ); + TQString jsVariable, jsValue; + for ( TQStringList::Iterator it = jsVariables.begin(); it != jsVariables.end(); ++it ) { jsVariable = (*it).section('=', 0, 0).stripWhiteSpace(); jsValue = (*it).section('=', 1); if ( jsVariable == "return" ) @@ -977,7 +977,7 @@ TagString exp_Script::expFunc( const ListPanel*, const QStringList& parameter, c if ( ! jsReturn.isEmpty() ) return krJS->getValue( jsReturn ).toString( krJS->globalExec() ).qstring(); else - return QString::null; + return TQString(); } #endif @@ -992,13 +992,13 @@ exp_View::exp_View() { //TODO: window-mode 'panel' should open the file in the third-hand viewer addParameter( exp_parameter( i18n("Choose a window mode:"), "__choose:tab;window", false ) ); } -TagString exp_View::expFunc( const ListPanel*, const QStringList& parameter, const bool&, Expander& exp ) const { +TagString exp_View::expFunc( const ListPanel*, const TQStringList& parameter, const bool&, Expander& exp ) const { if ( parameter[0].isEmpty() ) { setError(exp, Error(Error::S_FATAL,Error::C_ARGUMENT,i18n("Expander: no file to view in %_View(filename)%")) ); - return QString::null; + return TQString(); } - QString viewMode, windowMode; + TQString viewMode, windowMode; if ( parameter.count() <= 1 || parameter[1].isEmpty() ) viewMode = "generic"; else @@ -1017,7 +1017,7 @@ TagString exp_View::expFunc( const ListPanel*, const QStringList& parameter, con //TODO: Call the viewer with viewMode and windowMode. Filename is in parameter[0]. // It would be nice if parameter[0] could also be a space-separated filename-list (provided if the first parameter is %aList(selected)%) - return QString::null; // this doesn't return everything, that's normal! + return TQString(); // this doesn't return everything, that's normal! } ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -1026,13 +1026,13 @@ TagString exp_View::expFunc( const ListPanel*, const QStringList& parameter, con TagString exp_simpleplaceholder::expFunc( const ListPanel* p, const TagStringList& parameter, const bool& useUrl, Expander& exp) const { - QStringList lst; + TQStringList lst; for(TagStringList::const_iterator it=parameter.begin(),end=parameter.end();it!=end;++it) if((*it).isSimple()) lst.push_back((*it).string()); else { - setError(exp,Error(Error::S_FATAL,Error::C_SYNTAX,i18n("%Each% is not allowed in parameter to %1").arg(description()))); - return QString::null; + setError(exp,Error(Error::S_FATAL,Error::C_SYNTAX,i18n("%Each% is not allowed in parameter to %1").tqarg(description()))); + return TQString(); } return expFunc(p,lst,useUrl,exp); } @@ -1052,12 +1052,12 @@ ListPanel* Expander::getPanel( const char panelIndicator, const exp_placeholder* case '_': return 0; default: - exp.setError(Error(Error::S_FATAL,Error::C_SYNTAX,i18n("Expander: Bad panel specifier %1 in placeholder %2").arg(panelIndicator).arg(pl->description()))); + exp.setError(Error(Error::S_FATAL,Error::C_SYNTAX,i18n("Expander: Bad panel specifier %1 in placeholder %2").tqarg(panelIndicator).tqarg(pl->description()))); return 0; } } -void Expander::expand( const QString& stringToExpand, bool useUrl ) { +void Expander::expand( const TQString& stringToExpand, bool useUrl ) { TagString result = expandCurrent( stringToExpand, useUrl ); if ( error() ) return; @@ -1070,19 +1070,19 @@ void Expander::expand( const QString& stringToExpand, bool useUrl ) { // krOut << resultList[0] << endl; } -TagString Expander::expandCurrent( const QString& stringToExpand, bool useUrl ) { +TagString Expander::expandCurrent( const TQString& stringToExpand, bool useUrl ) { TagString result; - QString exp = QString::null; + TQString exp = TQString(); TagString tmpResult; int begin, end, i; // int brackets = 0; // bool inQuotes = false; unsigned int idx = 0; while ( idx < stringToExpand.length() ) { - if ( ( begin = stringToExpand.find( '%', idx ) ) == -1 ) break; + if ( ( begin = stringToExpand.tqfind( '%', idx ) ) == -1 ) break; if ( ( end = findEnd( stringToExpand, begin ) ) == -1 ) { setError(Error(Error::S_FATAL,Error::C_SYNTAX,i18n("Error: unterminated % in Expander::expandCurrent")) ); - return QString::null; + return TQString(); } result += stringToExpand.mid( idx, begin - idx ); // copy until the start of %exp% @@ -1091,19 +1091,19 @@ TagString Expander::expandCurrent( const QString& stringToExpand, bool useUrl ) exp = stringToExpand.mid( begin + 1, end - begin - 1 ); // kdDebug() << "------------- exp: '" << exp << "'" << endl; if ( exp == "" ) - result += QString(QChar('%')); + result += TQString(TQChar('%')); else { TagStringList parameter = separateParameter( &exp, useUrl ); if ( error() ) - return QString::null; + return TQString(); char panelIndicator = exp.lower()[0].latin1(); - exp.replace( 0, 1, "" ); + exp.tqreplace( 0, 1, "" ); for ( i = 0; i < placeholderCount(); ++i ) if ( exp == placeholder( i )->expression() ) { // kdDebug() << "---------------------------------------" << endl; tmpResult = placeholder( i )->expFunc( getPanel( panelIndicator,placeholder(i),*this ), parameter, useUrl, *this ); if ( error() ) { - return QString::null; + return TQString(); } else result += tmpResult; @@ -1111,8 +1111,8 @@ TagString Expander::expandCurrent( const QString& stringToExpand, bool useUrl ) break; } if ( i == placeholderCount() ) { // didn't find an expander - setError(Error(Error::S_FATAL,Error::C_SYNTAX,i18n("Error: unrecognized %%%1%2%% in Expander::expand").arg(panelIndicator).arg(exp)) ); - return QString::null; + setError(Error(Error::S_FATAL,Error::C_SYNTAX,i18n("Error: unrecognized %%%1%2%% in Expander::expand").tqarg(panelIndicator).tqarg(exp)) ); + return TQString(); } } //else idx = end + 1; @@ -1123,15 +1123,15 @@ TagString Expander::expandCurrent( const QString& stringToExpand, bool useUrl ) return result; } -QStringList Expander::splitEach( TagString stringToSplit ) { +TQStringList Expander::splitEach( TagString stringToSplit ) { if(stringToSplit.isSimple()) { // krOut << stringToSplit.string() << endl; return stringToSplit.string(); } - pair<uint,QStringList> pl=*stringToSplit.tagsBegin(); + pair<uint,TQStringList> pl=*stringToSplit.tagsBegin(); stringToSplit.eraseTag(stringToSplit.tagsBegin()); - QStringList ret; - for(QStringList::const_iterator it=pl.second.begin(),end=pl.second.end();it!=end;++it) { + TQStringList ret; + for(TQStringList::const_iterator it=pl.second.begin(),end=pl.second.end();it!=end;++it) { TagString s=stringToSplit; s.insert(pl.first,*it); ret+=splitEach(s); @@ -1140,13 +1140,13 @@ QStringList Expander::splitEach( TagString stringToSplit ) { // kdDebug() << "stringToSplit: " << stringToSplit << endl; } -TagStringList Expander::separateParameter( QString* const exp, bool useUrl ) { +TagStringList Expander::separateParameter( TQString* const exp, bool useUrl ) { TagStringList parameter; - QStringList parameter1; - QString result; + TQStringList parameter1; + TQString result; int begin, end; - if ( ( begin = exp->find( '(' ) ) != -1 ) { - if ( ( end = exp->findRev( ')' ) ) == -1 ) { + if ( ( begin = exp->tqfind( '(' ) ) != -1 ) { + if ( ( end = exp->tqfindRev( ')' ) ) == -1 ) { setError(Error(Error::S_FATAL,Error::C_SYNTAX,i18n("Error: missing ')' in Expander::separateParameter") )); return TagStringList(); } @@ -1159,7 +1159,7 @@ TagStringList Expander::separateParameter( QString* const exp, bool useUrl ) { while ( idx < result.length() ) { if ( result[ idx ].latin1() == '\\' ) { if ( result[ idx+1 ].latin1() == '"') - result.replace( idx, 1, "" ); + result.tqreplace( idx, 1, "" ); } if ( result[ idx ].latin1() == '"' ) inQuotes = !inQuotes; @@ -1172,7 +1172,7 @@ TagStringList Expander::separateParameter( QString* const exp, bool useUrl ) { } parameter1.append( result.mid( begin, idx - begin) ); //don't forget the last one - for (QStringList::Iterator it = parameter1.begin(); it != parameter1.end(); ++it) { + for (TQStringList::Iterator it = parameter1.begin(); it != parameter1.end(); ++it) { *it = (*it).stripWhiteSpace(); if ( (*it).left(1) == "\"" ) *it = (*it).mid(1, (*it).length() - 2 ); @@ -1186,11 +1186,11 @@ TagStringList Expander::separateParameter( QString* const exp, bool useUrl ) { return parameter; } -int Expander::findEnd( const QString& str, int start ) { - int end = str.find( '%', start + 1 ); +int Expander::findEnd( const TQString& str, int start ) { + int end = str.tqfind( '%', start + 1 ); if ( end == -1 ) return end; - int bracket = str.find( '(', start + 1 ); + int bracket = str.tqfind( '(', start + 1 ); if ( end < bracket || bracket == -1 ) return end; diff --git a/krusader/UserAction/expander.h b/krusader/UserAction/expander.h index 3d9cf72..a8b3156 100644 --- a/krusader/UserAction/expander.h +++ b/krusader/UserAction/expander.h @@ -13,18 +13,18 @@ #ifndef EXPANDER_H #define EXPANDER_H -// class QString; -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> +// class TQString; +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> #include "tstring.h" -// #include <qstringlist.h> +// #include <tqstringlist.h> class ListPanel; class Expander; class Error; -typedef TagString_t<QStringList> TagString; -typedef QValueList<TagString> TagStringList; +typedef TagString_t<TQStringList> TagString; +typedef TQValueList<TagString> TagStringList; /** * This holds informations about each parameter @@ -32,23 +32,23 @@ typedef QValueList<TagString> TagStringList; class exp_parameter { public: exp_parameter() {} - inline exp_parameter( QString desc, QString pre, bool ness) + inline exp_parameter( TQString desc, TQString pre, bool ness) { _description = desc; _preset = pre; _nessesary = ness; } - inline QString description() const ///< A description of the parameter + inline TQString description() const ///< A description of the parameter { return _description; } - inline QString preset() const ///< the default of the parameter + inline TQString preset() const ///< the default of the parameter { return _preset; } inline bool nessesary() const ///< false if the parameter is optional { return _nessesary; } private: - QString _description; - QString _preset; + TQString _description; + TQString _preset; bool _nessesary; }; #define EXP_FUNC virtual TagString expFunc ( const ListPanel*, const TagStringList&, const bool&, Expander& ) const -#define SIMPLE_EXP_FUNC virtual TagString expFunc ( const ListPanel*, const QStringList&, const bool&, Expander& ) const +#define SIMPLE_EXP_FUNC virtual TagString expFunc ( const ListPanel*, const TQStringList&, const bool&, Expander& ) const /** * Abstract baseclass for all expander-functions (which replace placeholder). * A Placeholder is an entry containing the expression, its expanding function and Parameter. @@ -59,9 +59,9 @@ private: */ class exp_placeholder { public: - inline QString expression() const ///< The placeholder (without '%' or panel-prefix) + inline TQString expression() const ///< The placeholder (without '%' or panel-prefix) { return _expression; } - inline QString description() const ///< A description of the placeholder + inline TQString description() const ///< A description of the placeholder { return _description; } inline bool needPanel() const ///< true if the placeholder needs a panel to operate on { return _needPanel; } @@ -75,15 +75,15 @@ public: EXP_FUNC = 0; protected: static void setError(Expander& exp,const Error& e) ; - static void panelMissingError(const QString &s, Expander& exp); - static QStringList splitEach(const TagString& s); - static QStringList fileList(const ListPanel* const panel,const QString& type,const QString& mask,const bool ommitPath,const bool useUrl,Expander&,const QString&); + static void panelMissingError(const TQString &s, Expander& exp); + static TQStringList splitEach(const TagString& s); + static TQStringList fileList(const ListPanel* const panel,const TQString& type,const TQString& tqmask,const bool ommitPath,const bool useUrl,Expander&,const TQString&); exp_placeholder(); exp_placeholder(const exp_placeholder& p); ~exp_placeholder() { } - QString _expression; - QString _description; - QValueList <exp_parameter> _parameter; + TQString _expression; + TQString _description; + TQValueList <exp_parameter> _parameter; bool _needPanel; }; @@ -97,14 +97,14 @@ protected: S_OK, S_WARNING, S_ERROR, S_FATAL }; Error() : s_(S_OK) {} - Error(Severity s,Cause c,QString d) : s_(s), c_(c), desc_(d) {} + Error(Severity s,Cause c,TQString d) : s_(s), c_(c), desc_(d) {} Cause cause() const { return c_; } operator bool() const { return s_!=S_OK; } - const QString& what() const { return desc_; } + const TQString& what() const { return desc_; } private: Severity s_; Cause c_; - QString desc_; + TQString desc_; }; @@ -120,7 +120,7 @@ protected: * - @em Count is replaced by a nomber of * -# Either "All", "Files", "Dirs", "Selected" * . - * - @em Filter is preplaced by the panels filter-mask (ex: "*.cpp *.h") + * - @em Filter is preplaced by the panels filter-tqmask (ex: "*.cpp *.h") * - @em Current is replaced by the current item or, in case of onmultiple="call_each", by each selected item. * -# If "yes", only the filename (without path) is returned * . @@ -128,12 +128,12 @@ protected: * -# Either "All", "Files", "Dirs", "Selected" * -# A seperator between the items (default: " " [one space]) * -# If "yes", only the filename (without path) is returned - * -# (for all but "Selected") a filter-mask (default: "*") + * -# (for all but "Selected") a filter-tqmask (default: "*") * . * . * - Access to panel-dependent, krusader-internal, parameter-needed functions (panel-indicator has to be 'a', 'o', 'r' or 'l') * - @em Select manipulates the selection of the panel - * -# A filter-mask (nessesary) + * -# A filter-tqmask (nessesary) * -# Either "Add", "Remove", "Set" (default) * . * - @em Bookmark manipulates the selection of the panel @@ -172,7 +172,7 @@ public: * @param useUrl true iff the path's should be expanded to an URL instead of an local path * @return a list of all commands */ - void expand( const QString& stringToExpand, bool useUrl ); + void expand( const TQString& stringToExpand, bool useUrl ); /** * Returns the list of all commands to be executed, provided that #expand was called @@ -180,7 +180,7 @@ public: * * @return The list of commands to be executed */ - const QStringList& result() const { assert(!error()); return resultList; } + const TQStringList& result() const { assert(!error()); return resultList; } /** * Returns the error object of this Expander. You can test whether there was @@ -203,14 +203,14 @@ protected: * @param useUrl true if the path's should be expanded to an URL instead of an local path * @return the expanded commanline for the current item */ - TagString expandCurrent( const QString& stringToExpand, bool useUrl ); + TagString expandCurrent( const TQString& stringToExpand, bool useUrl ); /** * This function searches for "@EACH"-marks to splitt the string in a list for each %_Each%-item * * @param stringToSplit the string which should be splitted * @return the splitted list */ - static QStringList splitEach( TagString stringToSplit ); + static TQStringList splitEach( TagString stringToSplit ); /** * @param panelIndicator either '_' for panel-independent placeholders, 'a', 'o', 'r', or 'l' for the active, other (inactive), right or left panel * @return a pointer to the right panel or NULL if no panel is needed. @@ -222,24 +222,24 @@ protected: * @param useUrl true if the path's should be expanded to an URL instead of an local path * @return a list of all parameter */ - TagStringList separateParameter( QString* const exp, bool useUrl ); + TagStringList separateParameter( TQString* const exp, bool useUrl ); /** * This finds the end of a placeholder, taking care of the parameter * @return the position where the placeholder ends */ - int findEnd( const QString& str, int start ); + int findEnd( const TQString& str, int start ); void setError(const Error &e) { _err=e; } friend class exp_placeholder; private: - static QValueList <const exp_placeholder*>& _placeholder(); + static TQValueList <const exp_placeholder*>& _placeholder(); Error _err; - QStringList resultList; + TQStringList resultList; }; inline void exp_placeholder::setError(Expander& exp,const Error& e) { exp.setError(e); } -inline QStringList exp_placeholder::splitEach(const TagString& s) { return Expander::splitEach(s); } +inline TQStringList exp_placeholder::splitEach(const TagString& s) { return Expander::splitEach(s); } inline exp_placeholder::exp_placeholder() { Expander::_placeholder().push_back(this); } #endif // ifndef EXPANDER_H diff --git a/krusader/UserAction/kraction.cpp b/krusader/UserAction/kraction.cpp index 9c9c89f..47aa222 100644 --- a/krusader/UserAction/kraction.cpp +++ b/krusader/UserAction/kraction.cpp @@ -14,14 +14,14 @@ #include <kdebug.h> #include <klocale.h> #include <kinputdialog.h> -#include <qtextedit.h> -#include <qvbox.h> -#include <qlayout.h> -#include <qsplitter.h> -#include <qpushbutton.h> -#include <qcheckbox.h> -#include <qfile.h> -#include <qlabel.h> +#include <tqtextedit.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqsplitter.h> +#include <tqpushbutton.h> +#include <tqcheckbox.h> +#include <tqfile.h> +#include <tqlabel.h> #include <kaction.h> #include <kurl.h> #include <kmessagebox.h> @@ -35,15 +35,15 @@ //for the availabilitycheck: #include <kmimetype.h> -#include <qregexp.h> +#include <tqregexp.h> ////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////// KrActionProcDlg ///////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////// -#include <qlayout.h> -KrActionProcDlg::KrActionProcDlg( QString caption, bool enableStderr, QWidget *parent ) : -KDialogBase( parent, 0, false, caption, KDialogBase::User1 | KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Cancel ), +#include <tqlayout.h> +KrActionProcDlg::KrActionProcDlg( TQString caption, bool enableStderr, TQWidget *tqparent ) : +KDialogBase( tqparent, 0, false, caption, KDialogBase::User1 | KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Cancel ), _stdout(0), _stderr(0), _currentTextEdit(0) { setButtonOK( i18n( "Close" ) ); @@ -53,36 +53,36 @@ _stdout(0), _stderr(0), _currentTextEdit(0) { setButtonText(KDialogBase::User1, i18n("Save as") ); - QVBox *page = makeVBoxMainWidget(); + TQVBox *page = makeVBoxMainWidget(); // do we need to separate stderr and stdout? if ( enableStderr ) { - QSplitter *splitt = new QSplitter( QSplitter::Vertical, page ); + TQSplitter *splitt = new TQSplitter( Qt::Vertical, page ); // create stdout - QVBox *stdoutBox = new QVBox( splitt, "stdout VBox" ); + TQVBox *stdoutBox = new TQVBox( splitt, "stdout VBox" ); stdoutBox->setSpacing( 6 ); - new QLabel( i18n( "Standard Output (stdout)" ), stdoutBox ); - _stdout = new QTextEdit( stdoutBox ); + new TQLabel( i18n( "Standard Output (stdout)" ), stdoutBox ); + _stdout = new TQTextEdit( stdoutBox ); _stdout->setReadOnly( true ); _stdout->setMinimumWidth( fontMetrics().maxWidth() * 40 ); // create stderr - QVBox *stderrBox = new QVBox( splitt, "stderr VBox" ); + TQVBox *stderrBox = new TQVBox( splitt, "stderr VBox" ); stderrBox->setSpacing( 6 ); - new QLabel( i18n( "Standard Error (stderr)" ), stderrBox ); - _stderr = new QTextEdit( stderrBox ); + new TQLabel( i18n( "Standard Error (stderr)" ), stderrBox ); + _stderr = new TQTextEdit( stderrBox ); _stderr->setReadOnly( true ); _stderr->setMinimumWidth( fontMetrics().maxWidth() * 40 ); } else { // create stdout - new QLabel( i18n( "Output" ), page ); - _stdout = new QTextEdit( page ); + new TQLabel( i18n( "Output" ), page ); + _stdout = new TQTextEdit( page ); _stdout->setReadOnly( true ); _stdout->setMinimumWidth( fontMetrics().maxWidth() * 40 ); } _currentTextEdit = _stdout; - connect( _stdout, SIGNAL( clicked(int, int) ), SLOT( currentTextEditChanged() ) ); + connect( _stdout, TQT_SIGNAL( clicked(int, int) ), TQT_SLOT( currentTextEditChanged() ) ); if (_stderr) - connect( _stderr, SIGNAL( clicked(int, int) ), SLOT( currentTextEditChanged() ) ); + connect( _stderr, TQT_SIGNAL( clicked(int, int) ), TQT_SLOT( currentTextEditChanged() ) ); krConfig->setGroup( "UserActions" ); normalFont = krConfig->readFontEntry( "Normal Font", _UserActions_NormalFont ); @@ -90,29 +90,29 @@ _stdout(0), _stderr(0), _currentTextEdit(0) { bool startupState = krConfig->readBoolEntry( "Use Fixed Font", _UserActions_UseFixedFont ); toggleFixedFont( startupState ); - // HACK This fetches the layout of the buttonbox from KDialogBase, although it is not accessable with KDialogBase's API + // HACK This fetches the tqlayout of the buttonbox from KDialogBase, although it is not accessable with KDialogBase's API // None the less it's quite save to use since this implementation hasn't changed since KDE-3.3 (I haven't looked at earlier // versions since we don't support them) and now all work is done in KDE-4. - QWidget* buttonBox = static_cast<QWidget*>( actionButton(KDialogBase::Ok)->parent() ); - QBoxLayout* buttonBoxLayout = static_cast<QBoxLayout*>( buttonBox->layout() ); - QCheckBox* useFixedFont = new QCheckBox( i18n("Use font with fixed width"), buttonBox ); + TQWidget* buttonBox = TQT_TQWIDGET( actionButton(KDialogBase::Ok)->tqparent() ); + TQBoxLayout* buttonBoxLayout = static_cast<TQBoxLayout*>( buttonBox->tqlayout() ); + TQCheckBox* useFixedFont = new TQCheckBox( i18n("Use font with fixed width"), buttonBox ); buttonBoxLayout->insertWidget( 0, useFixedFont ); useFixedFont->setChecked( startupState ); - connect( useFixedFont, SIGNAL( toggled(bool) ), SLOT( toggleFixedFont(bool) ) ); + connect( useFixedFont, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( toggleFixedFont(bool) ) ); } void KrActionProcDlg::addStderr( KProcess *, char *buffer, int buflen ) { if (_stderr) - _stderr->append( QString::fromLatin1( buffer, buflen ) ); + _stderr->append( TQString::tqfromLatin1( buffer, buflen ) ); else { _stdout->setItalic(true); - _stdout->append( QString::fromLatin1( buffer, buflen ) ); + _stdout->append( TQString::tqfromLatin1( buffer, buflen ) ); _stdout->setItalic(false); } } void KrActionProcDlg::addStdout( KProcess *, char *buffer, int buflen ) { - _stdout->append( QString::fromLatin1( buffer, buflen ) ); + _stdout->append( TQString::tqfromLatin1( buffer, buflen ) ); } void KrActionProcDlg::toggleFixedFont( bool state ) { @@ -129,13 +129,13 @@ void KrActionProcDlg::toggleFixedFont( bool state ) { } void KrActionProcDlg::slotUser1() { - QString filename = KFileDialog::getSaveFileName(QString::null, i18n("*.txt|Text files\n*|all files"), this); + TQString filename = KFileDialog::getSaveFileName(TQString(), i18n("*.txt|Text files\n*|all files"), this); if ( filename.isEmpty() ) return; - QFile file( filename ); + TQFile file( filename ); int answer = KMessageBox::Yes; if ( file.exists() ) - answer = KMessageBox::warningYesNoCancel( this, //parent + answer = KMessageBox::warningYesNoCancel( this, //tqparent i18n("This file already exists.\nDo you want to overwrite it or append the output?"), //text i18n("Overwrite or append?"), //caption i18n("Overwrite"), //label for Yes-Button @@ -151,13 +151,13 @@ void KrActionProcDlg::slotUser1() { if ( ! open ) { KMessageBox::error( this, - i18n("Can't open %1 for writing!\nNothing exported.").arg(filename), + i18n("Can't open %1 for writing!\nNothing exported.").tqarg(filename), i18n("Export failed!") ); return; } - QTextStream stream( &file ); + TQTextStream stream( &file ); stream << _currentTextEdit->text(); file.close(); } @@ -173,25 +173,25 @@ void KrActionProcDlg::currentTextEditChanged() { //////////////////////////////////// KrActionProc //////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////// -KrActionProc::KrActionProc( KrActionBase* action ) : QObject(), _action( action ), _proc( new KProcess(this) ), _output( 0 ) { +KrActionProc::KrActionProc( KrActionBase* action ) : TQObject(), _action( action ), _proc( new KProcess(this) ), _output( 0 ) { _proc->setUseShell( true ); - connect( _proc, SIGNAL( processExited( KProcess* ) ), - this, SLOT( processExited( KProcess* ) ) ) ; + connect( _proc, TQT_SIGNAL( processExited( KProcess* ) ), + this, TQT_SLOT( processExited( KProcess* ) ) ) ; } KrActionProc::~KrActionProc() { delete _proc; } -void KrActionProc::start( QString cmdLine ) { - QStringList list = cmdLine; +void KrActionProc::start( TQString cmdLine ) { + TQStringList list = cmdLine; start( list ); } -void KrActionProc::start( QStringList cmdLineList ) { +void KrActionProc::start( TQStringList cmdLineList ) { _proc->clearArguments(); - QString cmd; + TQString cmd; if ( ! _action->startpath().isEmpty() ) _proc->setWorkingDirectory( _action->startpath() ); @@ -208,7 +208,7 @@ void KrActionProc::start( QStringList cmdLineList ) { || ( _action->execType() == KrAction::RunInTE && MAIN_VIEW->konsole_part && MAIN_VIEW->konsole_part->widget() ) ) { // not collect output //TODO option to run them in paralell (not available for: collect output) - for ( QStringList::Iterator it = cmdLineList.begin(); it != cmdLineList.end(); ++it) { + for ( TQStringList::Iterator it = cmdLineList.begin(); it != cmdLineList.end(); ++it) { if ( ! cmd.isEmpty() ) cmd += " ; "; //TODO make this separator configurable (users may want && or || for spec. actions) cmd += *it; @@ -216,13 +216,13 @@ void KrActionProc::start( QStringList cmdLineList ) { //run in TE if ( _action->execType() == KrAction::RunInTE ) { //send the commandline contents to the terminal emulator - QKeyEvent keyEvent( QEvent::KeyPress, 0, -1, 0, cmd+"\n"); - QApplication::sendEvent( MAIN_VIEW->konsole_part->widget(), &keyEvent ); + TQKeyEvent keyEvent( TQEvent::KeyPress, 0, -1, 0, cmd+"\n"); + TQApplication::sendEvent( MAIN_VIEW->konsole_part->widget(), &keyEvent ); } else { // will start a new process // run in terminal if ( _action->execType() == KrAction::Terminal ) { krConfig->setGroup( "UserActions" ); - QString term = krConfig->readEntry( "Terminal", _UserActions_Terminal ); + TQString term = krConfig->readEntry( "Terminal", _UserActions_Terminal ); if ( _action->user().isEmpty() ) ( *_proc ) << term << cmd; @@ -244,11 +244,11 @@ void KrActionProc::start( QStringList cmdLineList ) { separateStderr = true; _output = new KrActionProcDlg( _action->text(), separateStderr ); // connect the output to the dialog - connect( _proc, SIGNAL( receivedStderr( KProcess*, char*, int ) ), _output, SLOT( addStderr( KProcess*, char *, int ) ) ); - connect( _proc, SIGNAL( receivedStdout( KProcess*, char*, int ) ), _output, SLOT( addStdout( KProcess*, char *, int ) ) ); - connect( _output, SIGNAL( cancelClicked() ), this, SLOT( kill() ) ); + connect( _proc, TQT_SIGNAL( receivedStderr( KProcess*, char*, int ) ), _output, TQT_SLOT( addStderr( KProcess*, char *, int ) ) ); + connect( _proc, TQT_SIGNAL( receivedStdout( KProcess*, char*, int ) ), _output, TQT_SLOT( addStdout( KProcess*, char *, int ) ) ); + connect( _output, TQT_SIGNAL( cancelClicked() ), this, TQT_SLOT( kill() ) ); _output->show(); - for ( QStringList::Iterator it = cmdLineList.begin(); it != cmdLineList.end(); ++it) { + for ( TQStringList::Iterator it = cmdLineList.begin(); it != cmdLineList.end(); ++it) { if ( ! cmd.isEmpty() ) cmd += " ; "; //TODO make this separator configurable (users may want && or ||) //TODO: read header fom config or action-properties and place it on top of each command @@ -280,8 +280,8 @@ void KrActionProc::processExited( KProcess * ) { /////////////////////////////////////// KrAction /////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////// -KrAction::KrAction( KActionCollection *parent, const char* name ) : KAction( parent, name ) { - connect(this, SIGNAL(activated()), this, SLOT(exec()) ); +KrAction::KrAction( KActionCollection *tqparent, const char* name ) : KAction( tqparent, name ) { + connect(this, TQT_SIGNAL(activated()), this, TQT_SLOT(exec()) ); } KrAction::~KrAction() { @@ -295,7 +295,7 @@ bool KrAction::isAvailable( const KURL& currentURL ) { //check protocol if ( ! _showonlyProtocol.empty() ) { available = false; - for ( QStringList::Iterator it = _showonlyProtocol.begin(); it != _showonlyProtocol.end(); ++it ) { + for ( TQStringList::Iterator it = _showonlyProtocol.begin(); it != _showonlyProtocol.end(); ++it ) { //kdDebug() << "KrAction::isAvailable currendProtocol: " << currentURL.protocol() << " =?= " << *it << endl; if ( currentURL.protocol() == *it ) { // FIXME remove trailing slashes at the xml-parsing (faster because done only once) available = true; @@ -307,9 +307,9 @@ bool KrAction::isAvailable( const KURL& currentURL ) { //check the Path-list: if ( ! _showonlyPath.empty() ) { available = false; - for ( QStringList::Iterator it = _showonlyPath.begin(); it != _showonlyPath.end(); ++it ) { + for ( TQStringList::Iterator it = _showonlyPath.begin(); it != _showonlyPath.end(); ++it ) { if ( (*it).right(1) == "*" ){ - if ( currentURL.path().find( (*it).left( (*it).length() - 1 ) ) == 0 ) { + if ( currentURL.path().tqfind( (*it).left( (*it).length() - 1 ) ) == 0 ) { available = true; break; } @@ -325,15 +325,15 @@ bool KrAction::isAvailable( const KURL& currentURL ) { if ( ! _showonlyMime.empty() ) { available = false; KMimeType::Ptr mime = KMimeType::findByURL( currentURL ); - for ( QStringList::Iterator it = _showonlyMime.begin(); it != _showonlyMime.end(); ++it ) { - if ( (*it).contains("/") ) { + for ( TQStringList::Iterator it = _showonlyMime.begin(); it != _showonlyMime.end(); ++it ) { + if ( (*it).tqcontains("/") ) { if ( mime->is( *it ) ) { // don't use ==; use 'is()' instead, which is aware of inheritence (ie: text/x-makefile is also text/plain) available = true; break; } } else { - if ( mime->name().find( *it ) == 0 ) { // 0 is the beginning, -1 is not found + if ( mime->name().tqfind( *it ) == 0 ) { // 0 is the beginning, -1 is not found available = true; break; } @@ -344,8 +344,8 @@ bool KrAction::isAvailable( const KURL& currentURL ) { //check filename if ( ! _showonlyFile.empty() ) { available = false; - for ( QStringList::Iterator it = _showonlyFile.begin(); it != _showonlyFile.end(); ++it ) { - QRegExp regex = QRegExp( *it, false, true ); // case-sensitive = false; wildcards = true + for ( TQStringList::Iterator it = _showonlyFile.begin(); it != _showonlyFile.end(); ++it ) { + TQRegExp regex = TQRegExp( *it, false, true ); // case-sensitive = false; wildcards = true if ( regex.exactMatch( currentURL.fileName() ) ) { available = true; break; @@ -357,7 +357,7 @@ bool KrAction::isAvailable( const KURL& currentURL ) { } -bool KrAction::xmlRead( const QDomElement& element ) { +bool KrAction::xmlRead( const TQDomElement& element ) { /* This has to be done elsewhere!! @@ -369,8 +369,8 @@ bool KrAction::xmlRead( const QDomElement& element ) { setName( element.attribute( "name" ).latin1() ); */ - for ( QDomNode node = element.firstChild(); !node.isNull(); node = node.nextSibling() ) { - QDomElement e = node.toElement(); + for ( TQDomNode node = element.firstChild(); !node.isNull(); node = node.nextSibling() ) { + TQDomElement e = node.toElement(); if ( e.isNull() ) continue; // this should skip nodes which are not elements ( i.e. comments, <!-- -->, or text nodes) @@ -406,18 +406,18 @@ bool KrAction::xmlRead( const QDomElement& element ) { if ( ! e.tagName().isEmpty() ) krOut << "KrAction::xmlRead() - unrecognized tag found: <action name=\"" << name() << "\"><" << e.tagName() << ">" << endl; - } // for ( QDomNode node = action->firstChild(); !node.isNull(); node = node.nextSibling() ) + } // for ( TQDomNode node = action->firstChild(); !node.isNull(); node = node.nextSibling() ) return true; } //KrAction::xmlRead -QDomElement KrAction::xmlDump( QDomDocument& doc ) const { - QDomElement actionElement = doc.createElement("action"); +TQDomElement KrAction::xmlDump( TQDomDocument& doc ) const { + TQDomElement actionElement = doc.createElement("action"); actionElement.setAttribute( "name", name() ); #define TEXT_ELEMENT( TAGNAME, TEXT ) \ { \ - QDomElement e = doc.createElement( TAGNAME ); \ + TQDomElement e = doc.createElement( TAGNAME ); \ e.appendChild( doc.createTextNode( TEXT ) ); \ actionElement.appendChild( e ); \ } @@ -441,7 +441,7 @@ QDomElement KrAction::xmlDump( QDomDocument& doc ) const { if ( ! startpath().isEmpty() ) TEXT_ELEMENT( "startpath", startpath() ) - QDomElement availabilityElement = dumpAvailability( doc ); + TQDomElement availabilityElement = dumpAvailability( doc ); if ( availabilityElement.hasChildNodes() ) actionElement.appendChild( availabilityElement ); @@ -451,8 +451,8 @@ QDomElement KrAction::xmlDump( QDomDocument& doc ) const { return actionElement; } //KrAction::xmlDump -void KrAction::readCommand( const QDomElement& element ) { - QString attr; +void KrAction::readCommand( const TQDomElement& element ) { + TQString attr; attr = element.attribute( "executionmode", "normal" ); // default: "normal" if ( attr == "normal") @@ -487,8 +487,8 @@ void KrAction::readCommand( const QDomElement& element ) { } //KrAction::readCommand -QDomElement KrAction::dumpCommand( QDomDocument& doc ) const { - QDomElement commandElement = doc.createElement("command"); +TQDomElement KrAction::dumpCommand( TQDomDocument& doc ) const { + TQDomElement commandElement = doc.createElement("command"); switch ( execType() ) { case Terminal: @@ -519,13 +519,13 @@ QDomElement KrAction::dumpCommand( QDomDocument& doc ) const { return commandElement; } //KrAction::dumpCommand -void KrAction::readAvailability( const QDomElement& element ) { - for ( QDomNode node = element.firstChild(); ! node.isNull(); node = node.nextSibling() ) { - QDomElement e = node.toElement(); +void KrAction::readAvailability( const TQDomElement& element ) { + for ( TQDomNode node = element.firstChild(); ! node.isNull(); node = node.nextSibling() ) { + TQDomElement e = node.toElement(); if ( e.isNull() ) continue; // this should skip nodes which are not elements ( i.e. comments, <!-- -->, or text nodes) - QStringList* showlist = 0; + TQStringList* showlist = 0; if ( e.tagName() == "protocol" ) showlist = &_showonlyProtocol; @@ -544,8 +544,8 @@ void KrAction::readAvailability( const QDomElement& element ) { } if ( showlist ) { - for ( QDomNode subnode = e.firstChild(); ! subnode.isNull(); subnode = subnode.nextSibling() ) { - QDomElement subelement = subnode.toElement(); + for ( TQDomNode subnode = e.firstChild(); ! subnode.isNull(); subnode = subnode.nextSibling() ) { + TQDomElement subelement = subnode.toElement(); if ( subelement.tagName() == "show" ) showlist->append( subelement.text() ); } // for @@ -554,14 +554,14 @@ void KrAction::readAvailability( const QDomElement& element ) { } // for } //KrAction::readAvailability -QDomElement KrAction::dumpAvailability( QDomDocument& doc ) const { - QDomElement availabilityElement = doc.createElement("command"); +TQDomElement KrAction::dumpAvailability( TQDomDocument& doc ) const { + TQDomElement availabilityElement = doc.createElement("command"); # define LIST_ELEMENT( TAGNAME, LIST ) \ { \ - QDomElement e = doc.createElement( TAGNAME ); \ - for ( QStringList::const_iterator it = LIST.constBegin(); it != LIST.constEnd(); ++it ) { \ - QDomElement show = doc.createElement( "show" ); \ + TQDomElement e = doc.createElement( TAGNAME ); \ + for ( TQStringList::const_iterator it = LIST.constBegin(); it != LIST.constEnd(); ++it ) { \ + TQDomElement show = doc.createElement( "show" ); \ show.appendChild( doc.createTextNode( *it ) ); \ e.appendChild( show ); \ } \ diff --git a/krusader/UserAction/kraction.h b/krusader/UserAction/kraction.h index 2d8b81b..dec91e1 100644 --- a/krusader/UserAction/kraction.h +++ b/krusader/UserAction/kraction.h @@ -19,10 +19,10 @@ #include "kractionbase.h" class UserActionProperties; -class QTextEdit; +class TQTextEdit; class KActionCollection; -class QDomElement; -class QDomDocument; +class TQDomElement; +class TQDomDocument; /** * This subclass of KAction extends it with an individual executor and a struct UserActionProperties. It is used to integrate useractions into KDE's KAction-System @@ -30,8 +30,9 @@ class QDomDocument; */ class KrAction: public KAction, public KrActionBase { Q_OBJECT + TQ_OBJECT public: - KrAction( KActionCollection *parent, const char* name ); + KrAction( KActionCollection *tqparent, const char* name ); ~KrAction(); /** @@ -41,22 +42,22 @@ class KrAction: public KAction, public KrActionBase { */ bool isAvailable( const KURL& currentURL ); - bool xmlRead( const QDomElement& element ); - QDomElement xmlDump( QDomDocument& doc ) const; + bool xmlRead( const TQDomElement& element ); + TQDomElement xmlDump( TQDomDocument& doc ) const; void setName( const char* ) { /* empty reimplementation to prevent a name-change */ }; - QString category() const { return _category; }; - void setCategory( const QString& category ) { _category = category; }; + TQString category() const { return _category; }; + void setCategory( const TQString& category ) { _category = category; }; - QString command() const { return _command; }; - void setCommand( const QString& command ) { _command = command; }; + TQString command() const { return _command; }; + void setCommand( const TQString& command ) { _command = command; }; - QString user() const { return _user; }; - void setUser( const QString& user ) { _user = user; }; + TQString user() const { return _user; }; + void setUser( const TQString& user ) { _user = user; }; - QString startpath() const { return _startpath; }; - void setStartpath( const QString& startpath ) { _startpath = startpath; }; + TQString startpath() const { return _startpath; }; + void setStartpath( const TQString& startpath ) { _startpath = startpath; }; ExecType execType() const { return _execType; }; void setExecType( ExecType execType ) { _execType = execType; }; @@ -67,23 +68,23 @@ class KrAction: public KAction, public KrActionBase { bool confirmExecution() const { return _confirmExecution; }; void setConfirmExecution(const bool& confirmExecution) { _confirmExecution = confirmExecution; }; - QStringList showonlyProtocol() const { return _showonlyProtocol; }; - void setShowonlyProtocol( const QStringList& showonlyProtocol ) { _showonlyProtocol = showonlyProtocol; }; + TQStringList showonlyProtocol() const { return _showonlyProtocol; }; + void setShowonlyProtocol( const TQStringList& showonlyProtocol ) { _showonlyProtocol = showonlyProtocol; }; - QStringList showonlyPath() const { return _showonlyPath; }; - void setShowonlyPath( const QStringList& showonlyPath ) { _showonlyPath = showonlyPath; }; + TQStringList showonlyPath() const { return _showonlyPath; }; + void setShowonlyPath( const TQStringList& showonlyPath ) { _showonlyPath = showonlyPath; }; - QStringList showonlyMime() const { return _showonlyMime; }; - void setShowonlyMime( const QStringList& showonlyMime ) { _showonlyMime = showonlyMime; }; + TQStringList showonlyMime() const { return _showonlyMime; }; + void setShowonlyMime( const TQStringList& showonlyMime ) { _showonlyMime = showonlyMime; }; - QStringList showonlyFile() const { return _showonlyFile; }; - void setShowonlyFile( const QStringList& showonlyFile ) { _showonlyFile = showonlyFile; }; + TQStringList showonlyFile() const { return _showonlyFile; }; + void setShowonlyFile( const TQStringList& showonlyFile ) { _showonlyFile = showonlyFile; }; bool doSubstitution() const { return true; } - QString text() const { + TQString text() const { return KAction::text(); } @@ -94,35 +95,36 @@ class KrAction: public KAction, public KrActionBase { private: - void readCommand( const QDomElement& element ); - QDomElement dumpCommand( QDomDocument& doc ) const; + void readCommand( const TQDomElement& element ); + TQDomElement dumpCommand( TQDomDocument& doc ) const; - void readAvailability( const QDomElement& element ); - QDomElement dumpAvailability( QDomDocument& doc ) const; + void readAvailability( const TQDomElement& element ); + TQDomElement dumpAvailability( TQDomDocument& doc ) const; - QString _category; - QString _command; - QString _user; - QString _startpath; + TQString _category; + TQString _command; + TQString _user; + TQString _startpath; ExecType _execType; bool _acceptURLs; bool _confirmExecution; - QStringList _showonlyProtocol; - QStringList _showonlyPath; - QStringList _showonlyMime; - QStringList _showonlyFile; + TQStringList _showonlyProtocol; + TQStringList _showonlyPath; + TQStringList _showonlyMime; + TQStringList _showonlyFile; }; -class QFont; +class TQFont; /** * This displays the output of a process * @author Shie Erlich, Jonas Bähr */ class KrActionProcDlg: public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KrActionProcDlg( QString caption, bool enableStderr = false, QWidget *parent = 0 ); + KrActionProcDlg( TQString caption, bool enableStderr = false, TQWidget *tqparent = 0 ); protected slots: void addStderr( KProcess *proc, char *buffer, int buflen ); @@ -131,8 +133,8 @@ class KrActionProcDlg: public KDialogBase { void slotUser1(); ///< This is used to save the buffer to disc private: - QTextEdit *_stdout, *_stderr, *_currentTextEdit; - QFont normalFont, fixedFont; + TQTextEdit *_stdout, *_stderr, *_currentTextEdit; + TQFont normalFont, fixedFont; private slots: void currentTextEditChanged(); }; @@ -142,14 +144,15 @@ class KrActionProcDlg: public KDialogBase { * @author Shie Erlich, Jonas Bähr * @todo jonas: call a list of commands separately (I began it but it doesn't work) */ -class KrActionProc: public QObject { +class KrActionProc: public TQObject { Q_OBJECT + TQ_OBJECT public: KrActionProc( KrActionBase* action ); virtual ~KrActionProc(); - void start( QString cmdLine ); - void start( QStringList cmdLineList ); + void start( TQString cmdLine ); + void start( TQStringList cmdLineList ); protected slots: void kill() { _proc->kill( SIGINT ); } @@ -158,8 +161,8 @@ class KrActionProc: public QObject { private: KrActionBase* _action; KProcess *_proc; - QString _stdout; - QString _stderr; + TQString _stdout; + TQString _stderr; KrActionProcDlg *_output; }; diff --git a/krusader/UserAction/kractionbase.cpp b/krusader/UserAction/kractionbase.cpp index 233a218..b13166e 100644 --- a/krusader/UserAction/kractionbase.cpp +++ b/krusader/UserAction/kractionbase.cpp @@ -13,7 +13,7 @@ #include <kinputdialog.h> #include <klocale.h> -#include <qerrormessage.h> +#include <tqerrormessage.h> #include "kraction.h" #include "expander.h" @@ -26,8 +26,8 @@ KrActionBase::~KrActionBase() void KrActionBase::exec() { KrActionProc *proc; - // replace %% and prepare string - QStringList commandList; + // tqreplace %% and prepare string + TQStringList commandList; if(doSubstitution()) { Expander exp; exp.expand(command(),acceptURLs()); @@ -45,7 +45,7 @@ void KrActionBase::exec() { return; if ( confirmExecution() ) { - for ( QStringList::iterator it = commandList.begin(); it != commandList.end(); ++it ) { + for ( TQStringList::iterator it = commandList.begin(); it != commandList.end(); ++it ) { bool exec = true; *it = KInputDialog::getText( i18n( "Confirm execution" ), @@ -68,7 +68,7 @@ void KrActionBase::exec() { void KrActionBase::handleError(const Error& err) { - QErrorMessage::qtHandler()->message(err.what()); + TQErrorMessage::qtHandler()->message(err.what()); } KrActionProc* KrActionBase::actionProcFactoryMethod() diff --git a/krusader/UserAction/kractionbase.h b/krusader/UserAction/kractionbase.h index 271dfb7..6691a06 100644 --- a/krusader/UserAction/kractionbase.h +++ b/krusader/UserAction/kractionbase.h @@ -12,7 +12,7 @@ #ifndef KRACTIONBASE_H #define KRACTIONBASE_H -#include <qstring.h> +#include <tqstring.h> #include "expander.h" class KrActionProc; @@ -44,7 +44,7 @@ public: * * @return The command to execute */ - virtual QString command() const =0; + virtual TQString command() const =0; /** \brief Execution type of the action * * @see #ExecType @@ -55,19 +55,19 @@ public: * @return The working directory of the command. May be \a null, * in which case the command is executed in current directory */ - virtual QString startpath() const =0; + virtual TQString startpath() const =0; /** \brief Username under which the command is run * * @return The username of the command. May be \a null, * in which case the command is executed under the current user */ - virtual QString user() const=0; + virtual TQString user() const=0; /** \brief Name of the action * * @return The name of the action which will be shown to the user * eg. any string will do */ - virtual QString text() const=0; + virtual TQString text() const=0; /** \brief Does the command accept URLs as filenames (like KDE apps)? * * @return \a true iff it does diff --git a/krusader/UserAction/tstring.h b/krusader/UserAction/tstring.h index 2ddd80c..b479e59 100644 --- a/krusader/UserAction/tstring.h +++ b/krusader/UserAction/tstring.h @@ -10,28 +10,28 @@ #ifndef __TAGSTRING__H #define __TAGSTRING__H -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <utility> #include <cassert> template <class T> class TagString_t { - QString str; - typedef QValueList<std::pair<uint,T> > taglist; // may change + TQString str; + typedef TQValueList<std::pair<uint,T> > taglist; // may change taglist tags; public: - TagString_t(const QString& s) : str(s) {} + TagString_t(const TQString& s) : str(s) {} TagString_t() {} bool isSimple() const { return tags.empty(); } - const QString& string() const { return str; } + const TQString& string() const { return str; } unsigned length() const { return str.length(); } TagString_t mid(unsigned idx,unsigned len=~0) const; TagString_t left(unsigned) const; TagString_t right(unsigned) const; - void insert(uint,const QString& s); - int find ( QChar c, int index = 0, bool cs = TRUE ) const { - return str.find(c,index,cs); + void insert(uint,const TQString& s); + int tqfind ( TQChar c, int index = 0, bool cs = TRUE ) const { + return str.tqfind(c,index,cs); } TagString_t& operator+=(const TagString_t& s); typename taglist::const_iterator tagsBegin() const { return tags.begin(); } @@ -40,7 +40,7 @@ public: typename taglist::iterator tagsEnd() { return tags.end(); } void insertTag(uint pos,const T& t); void eraseTag(const typename taglist::iterator& which) { tags.erase(which); } -/* void insert(uint idx,const QString&); +/* void insert(uint idx,const TQString&); void insert(uint idx,const char*); void addTag(uint); void remove(uint start,uint len);*/ @@ -82,7 +82,7 @@ TagString_t<T> TagString_t<T>::right(unsigned len) const } template <class T> -void TagString_t<T>::insert(uint idx,const QString& s) +void TagString_t<T>::insert(uint idx,const TQString& s) { str.insert(idx,s); const unsigned disp=s.length(); diff --git a/krusader/UserAction/useraction.cpp b/krusader/UserAction/useraction.cpp index f1a9a4b..5bf59fa 100644 --- a/krusader/UserAction/useraction.cpp +++ b/krusader/UserAction/useraction.cpp @@ -16,8 +16,8 @@ #include <kstandarddirs.h> #include <kmessagebox.h> -#include <qstring.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdom.h> #include "useraction.h" #include "kraction.h" @@ -56,18 +56,18 @@ void UserAction::populateMenu( KPopupMenu* menu ) { action->plug( menu ); } -QStringList UserAction::allCategories() { - QStringList actionCategories; +TQStringList UserAction::allCategories() { + TQStringList actionCategories; for ( KrAction* action = _actions.first(); action; action = _actions.next() ) - if ( actionCategories.find( action->category() ) == actionCategories.end() ) + if ( actionCategories.tqfind( action->category() ) == actionCategories.end() ) actionCategories.append( action->category() ); return actionCategories; } -QStringList UserAction::allNames() { - QStringList actionNames; +TQStringList UserAction::allNames() { + TQStringList actionNames; for ( KrAction* action = _actions.first(); action; action = _actions.next() ) actionNames.append( action->name() ); @@ -76,7 +76,7 @@ QStringList UserAction::allNames() { } void UserAction::readAllFiles() { - QString filename = locate( "data", ACTION_XML ); // locate returns the local file if it exists, else the global one is retrieved. + TQString filename = locate( "data", ACTION_XML ); // locate returns the local file if it exists, else the global one is retrieved. if ( ! filename.isEmpty() ) readFromFile( locate( "data", ACTION_XML ), renameDoublicated ); @@ -85,9 +85,9 @@ void UserAction::readAllFiles() { readFromFile( locate( "data", ACTION_XML_EXAMPLES ), ignoreDoublicated ); // ignore samples which are already in the normal file } -void UserAction::readFromFile( const QString& filename, ReadMode mode, KrActionList* list ) { - QDomDocument* doc = new QDomDocument( ACTION_DOCTYPE ); - QFile file( filename ); +void UserAction::readFromFile( const TQString& filename, ReadMode mode, KrActionList* list ) { + TQDomDocument* doc = new TQDomDocument( ACTION_DOCTYPE ); + TQFile file( filename ); if( file.open( IO_ReadOnly ) ) { //kdDebug() << "UserAction::readFromFile - " << filename << "could be opened" << endl; if( ! doc->setContent( &file ) ) { @@ -97,18 +97,18 @@ void UserAction::readFromFile( const QString& filename, ReadMode mode, KrActionL file.close(); delete doc; doc = 0; KMessageBox::error( MAIN_VIEW, - i18n( "The file %1 does not contain valid UserActions.\n" ).arg( filename ), // text + i18n( "The file %1 does not contain valid UserActions.\n" ).tqarg( filename ), // text i18n("UserActions - can't read from file!") // caption ); } file.close(); if ( doc ) { - QDomElement root = doc->documentElement(); + TQDomElement root = doc->documentElement(); // check if the file got the right root-element (ACTION_ROOT) - this finds out if the xml-file read to the DOM is realy an krusader useraction-file if( root.tagName() != ACTION_ROOT ) { KMessageBox::error( MAIN_VIEW, - i18n( "The actionfile's root-element isn't called "ACTION_ROOT", using %1").arg( filename ), + i18n( "The actionfile's root-element isn't called "ACTION_ROOT", using %1").tqarg( filename ), i18n( "UserActions - can't read from file!" ) ); delete doc; doc = 0; @@ -120,21 +120,21 @@ void UserAction::readFromFile( const QString& filename, ReadMode mode, KrActionL } // if ( file.open( IO_ReadOnly ) ) else { KMessageBox::error( MAIN_VIEW, - i18n( "Unable to open actionfile %1").arg( filename ), + i18n( "Unable to open actionfile %1").tqarg( filename ), i18n( "UserActions - can't read from file!" ) ); } } -void UserAction::readFromElement( const QDomElement& element, ReadMode mode, KrActionList* list ) { - for ( QDomNode node = element.firstChild(); ! node.isNull(); node = node.nextSibling() ) { - QDomElement e = node.toElement(); +void UserAction::readFromElement( const TQDomElement& element, ReadMode mode, KrActionList* list ) { + for ( TQDomNode node = element.firstChild(); ! node.isNull(); node = node.nextSibling() ) { + TQDomElement e = node.toElement(); if ( e.isNull() ) continue; // this should skip nodes which are not elements ( i.e. comments, <!-- -->, or text nodes) if ( e.tagName() == "action" ) { - QString name = e.attribute( "name" ); + TQString name = e.attribute( "name" ); if ( name.isEmpty() ) { KMessageBox::error( MAIN_VIEW, i18n( "Action without name detected. This action will not be imported!\nThis is an error in the file, you may want to correct it." ), @@ -146,11 +146,11 @@ void UserAction::readFromElement( const QDomElement& element, ReadMode mode, KrA if ( mode == ignoreDoublicated && krApp->actionCollection()->action( name.latin1() ) ) continue; - QString basename = name + "_%1"; + TQString basename = name + "_%1"; int i = 0; // appent a counter till the name is unique... (this checks every action, not only useractions) while ( krApp->actionCollection()->action( name.latin1() ) ) - name = basename.arg( ++i ); + name = basename.tqarg( ++i ); KrAction* act = new KrAction( krApp->actionCollection(), name.latin1() ); if ( act->xmlRead( e ) ) { @@ -164,8 +164,8 @@ void UserAction::readFromElement( const QDomElement& element, ReadMode mode, KrA } // for } -QDomDocument UserAction::createEmptyDoc() { - QDomDocument doc = QDomDocument( ACTION_DOCTYPE ); +TQDomDocument UserAction::createEmptyDoc() { + TQDomDocument doc = TQDomDocument( ACTION_DOCTYPE ); // adding: <?xml version="1.0" encoding="UTF-8" ?> doc.appendChild( doc.createProcessingInstruction( "xml", ACTION_PROCESSINSTR ) ); //adding root-element @@ -174,30 +174,30 @@ QDomDocument UserAction::createEmptyDoc() { } bool UserAction::writeActionFile() { - QString filename = locateLocal( "data", ACTION_XML ); + TQString filename = locateLocal( "data", ACTION_XML ); - QDomDocument doc = createEmptyDoc(); - QDomElement root = doc.documentElement(); + TQDomDocument doc = createEmptyDoc(); + TQDomElement root = doc.documentElement(); for ( KrAction* action = _actions.first(); action; action = _actions.next() ) root.appendChild( action->xmlDump( doc ) ); return writeToFile( doc, filename ); } -bool UserAction::writeToFile( const QDomDocument& doc, const QString& filename ) { - QFile file( filename ); +bool UserAction::writeToFile( const TQDomDocument& doc, const TQString& filename ) { + TQFile file( filename ); if( ! file.open( IO_WriteOnly ) ) return false; /* // This is not needed, because each DomDocument created with UserAction::createEmptyDoc already contains the processinstruction if ( ! doc.firstChild().isProcessingInstruction() ) { // adding: <?xml version="1.0" encoding="UTF-8" ?> if not already present - QDomProcessingInstruction instr = doc.createProcessingInstruction( "xml", ACTION_PROCESSINSTR ); + TQDomProcessingInstruction instr = doc.createProcessingInstruction( "xml", ACTION_PROCESSINSTR ); doc.insertBefore( instr, doc.firstChild() ); } */ - QTextStream ts( &file ); + TQTextStream ts( &file ); ts.setEncoding(ts.UnicodeUTF8); ts << doc.toString(); diff --git a/krusader/UserAction/useraction.h b/krusader/UserAction/useraction.h index cfdeee8..8cd5691 100644 --- a/krusader/UserAction/useraction.h +++ b/krusader/UserAction/useraction.h @@ -13,12 +13,12 @@ #ifndef USERACTION_H #define USERACTION_H -#include <qptrlist.h> +#include <tqptrlist.h> -class QDomDocument; -class QDomElement; -class QString; -class QStringList; +class TQDomDocument; +class TQDomElement; +class TQString; +class TQStringList; class KrAction; class KURL; class KPopupMenu; @@ -42,7 +42,7 @@ class KPopupMenu; class UserAction { public: - typedef QPtrList<KrAction> KrActionList; + typedef TQPtrList<KrAction> KrActionList; enum ReadMode { renameDoublicated, ignoreDoublicated }; @@ -91,8 +91,8 @@ public: */ void populateMenu(KPopupMenu* menu); - QStringList allCategories(); - QStringList allNames(); + TQStringList allCategories(); + TQStringList allNames(); /** * reads all predefined useractionfiles. @@ -106,26 +106,26 @@ public: * Reads UserActions from a xml-file. * @param list If provided, all new actions will also be added to this list */ - void readFromFile( const QString& filename, ReadMode mode = renameDoublicated, KrActionList* list = 0 ); + void readFromFile( const TQString& filename, ReadMode mode = renameDoublicated, KrActionList* list = 0 ); /** * Reads UserActions from a XML-Element. * @param element a container with action-elements * @param list If provided, all new actions will also be added to this list */ - void readFromElement( const QDomElement& element, ReadMode mode = renameDoublicated, KrActionList* list = 0 ); + void readFromElement( const TQDomElement& element, ReadMode mode = renameDoublicated, KrActionList* list = 0 ); /** - * creates an empty QDomDocument for the UserActions + * creates an empty TQDomDocument for the UserActions */ - static QDomDocument createEmptyDoc(); + static TQDomDocument createEmptyDoc(); /** - * Writes a QDomDocument to an UTF-8 encodes text-file + * Writes a TQDomDocument to an UTF-8 encodes text-file * @param doc the XML-Tree * @param filename the filename where to save * @return true on success, false otherwise * @warning any existing file will get overwritten! */ - static bool writeToFile( const QDomDocument& doc, const QString& filename ); + static bool writeToFile( const TQDomDocument& doc, const TQString& filename ); private: KrActionList _actions; diff --git a/krusader/UserAction/useractionpopupmenu.cpp b/krusader/UserAction/useractionpopupmenu.cpp index 0b70647..4339e78 100644 --- a/krusader/UserAction/useractionpopupmenu.cpp +++ b/krusader/UserAction/useractionpopupmenu.cpp @@ -18,7 +18,7 @@ #include "useraction.h" #include "kraction.h" -UserActionPopupMenu::UserActionPopupMenu( KURL currentURL, QWidget *parent ) : KPopupMenu( parent, "useraction popupmenu" ) { +UserActionPopupMenu::UserActionPopupMenu( KURL currentURL, TQWidget *tqparent ) : KPopupMenu( tqparent, "useraction popupmenu" ) { UserAction::KrActionList list = krUserAction->actionList(); for ( KrAction* action = list.first(); action; action = list.next() ) if ( action->isAvailable( currentURL ) ) diff --git a/krusader/UserAction/useractionpopupmenu.h b/krusader/UserAction/useractionpopupmenu.h index 8bf36ba..4453dfd 100644 --- a/krusader/UserAction/useractionpopupmenu.h +++ b/krusader/UserAction/useractionpopupmenu.h @@ -19,7 +19,7 @@ class KURL; class UserActionPopupMenu : public KPopupMenu { public: - UserActionPopupMenu( KURL currentURL, QWidget *parent = 0 ); + UserActionPopupMenu( KURL currentURL, TQWidget *tqparent = 0 ); }; #endif // ifndef USERACTIONPOPUPMENU_H |