diff options
Diffstat (limited to 'kpf/src/DirectoryLister.cpp')
-rw-r--r-- | kpf/src/DirectoryLister.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/kpf/src/DirectoryLister.cpp b/kpf/src/DirectoryLister.cpp index bfd0127b..b642d912 100644 --- a/kpf/src/DirectoryLister.cpp +++ b/kpf/src/DirectoryLister.cpp @@ -23,12 +23,12 @@ #include <cmath> -#include <qapplication.h> -#include <qdir.h> -#include <qstring.h> -#include <qstylesheet.h> -#include <qpalette.h> -#include <qtextstream.h> +#include <tqapplication.h> +#include <tqdir.h> +#include <tqstring.h> +#include <tqstylesheet.h> +#include <tqpalette.h> +#include <tqtextstream.h> #include <kglobalsettings.h> #include <klocale.h> #include <kmimetype.h> @@ -49,25 +49,25 @@ namespace KPF } }; - QString colorToCSS(const QColor &c) + TQString colorToCSS(const TQColor &c) { return "rgb(" - + QString::number(c.red()) + + TQString::number(c.red()) + ", " - + QString::number(c.green()) + + TQString::number(c.green()) + ", " - + QString::number(c.blue()) + + TQString::number(c.blue()) + ")"; } - QByteArray buildHTML(const QString & title, const QString & body) + TQByteArray buildHTML(const TQString & title, const TQString & body) { - QPalette pal = qApp->palette(); - QByteArray temp_string; - QTextStream html(temp_string, IO_WriteOnly); + TQPalette pal = qApp->palette(); + TQByteArray temp_string; + TQTextStream html(temp_string, IO_WriteOnly); - html.setEncoding(QTextStream::UnicodeUTF8); + html.setEncoding(TQTextStream::UnicodeUTF8); html << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" @@ -90,10 +90,10 @@ namespace KPF << endl << "table.filelist { " << "color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::Foreground)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::Foreground)) << "; " << "background-color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::Background)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::Background)) << "; " << "border: thin outset; " << "width: 100%; " @@ -106,10 +106,10 @@ namespace KPF << endl << "td.norm { " << "background-color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::Base)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::Base)) << "; " << "color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::Foreground)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::Foreground)) << "; " << "}" << endl @@ -118,27 +118,27 @@ namespace KPF << colorToCSS ( KGlobalSettings::calculateAlternateBackgroundColor - (pal.color(QPalette::Normal, QColorGroup::Base)) + (pal.color(TQPalette::Normal, TQColorGroup::Base)) ) << "; " << "color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::Foreground)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::Foreground)) << "; " << "}" << endl << "a { " << "color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::Text)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::Text)) << "; " << "text-decoration: none; " << "}" << endl << "th.listheading { " << "color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::ButtonText)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::ButtonText)) << "; " << "background-color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::Button)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::Button)) << "; " << "text-align: left; " << "white-space: nowrap; " @@ -151,7 +151,7 @@ namespace KPF << endl << "div.sizeentry { " << "color: " - << colorToCSS(pal.color(QPalette::Normal, QColorGroup::Text)) + << colorToCSS(pal.color(TQPalette::Normal, TQColorGroup::Text)) << "; " << "text-align: right; " << "}" @@ -174,10 +174,10 @@ namespace KPF return temp_string; } - QString prettySize(uint size) + TQString prettySize(uint size) { - QString suffix; - QString temp; + TQString suffix; + TQString temp; float floated_size; if (size > 1023) @@ -227,11 +227,11 @@ namespace KPF } QByteArray - DirectoryLister::html(const QString & root, const QString & _path) + DirectoryLister::html(const TQString & root, const TQString & _path) { kpfDebug << "root: " << root << " path: " << _path << endl; - QString path; + TQString path; if (_path.right(1) != "/") path = _path + "/"; @@ -241,7 +241,7 @@ namespace KPF if (path[0] == '/') path + ""; - QDir d(root + path); + TQDir d(root + path); if (!d.exists()) { @@ -253,7 +253,7 @@ namespace KPF } const QFileInfoList * infoList = - d.entryInfoList(QDir::DefaultFilter, QDir::Name | QDir::DirsFirst); + d.entryInfoList(TQDir::DefaultFilter, TQDir::Name | TQDir::DirsFirst); if (0 == infoList) { @@ -264,7 +264,7 @@ namespace KPF ); } - QString html; + TQString html; html += "<table"; html += " width=\"100%\""; @@ -279,7 +279,7 @@ namespace KPF { static int counter = 0; - QFileInfo * fi(it.current()); + TQFileInfo * fi(it.current()); if ( (fi->fileName()[0] == '.') @@ -292,13 +292,13 @@ namespace KPF ++counter; - QString td_class = (counter % 2) ? "alt" : "norm"; + TQString td_class = (counter % 2) ? "alt" : "norm"; html += "<tr>\n"; html += "<td class=\"" + td_class + "\">"; - QString item_class = QString((fi->isDir()) ? "direntry" : "fileentry"); + TQString item_class = TQString((fi->isDir()) ? "direntry" : "fileentry"); KURL fu(path+fi->fileName()); html += @@ -310,7 +310,7 @@ namespace KPF + "\">"; if (fi->fileName() != "..") - html += QStyleSheet::escape(fi->fileName()); + html += TQStyleSheet::escape(fi->fileName()); else html += i18n("Parent Directory"); @@ -335,7 +335,7 @@ namespace KPF return buildHTML ( - i18n("Directory listing for %1").arg(QStyleSheet::escape(path)), + i18n("Directory listing for %1").arg(TQStyleSheet::escape(path)), html ); } |