summaryrefslogtreecommitdiffstats
path: root/src/logviewer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-16 23:01:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-16 23:01:29 +0000
commit4304e8d9dab8e20513e38e71b0debdf6937b630c (patch)
tree76a86f013a811449a5b5bfbbbb962e7db0bbcc6a /src/logviewer.cpp
parentba24506b3bb46312d998468ad3c1a7f28058b2bd (diff)
downloadtdepowersave-4304e8d9dab8e20513e38e71b0debdf6937b630c.tar.gz
tdepowersave-4304e8d9dab8e20513e38e71b0debdf6937b630c.zip
Finish TQt4 port of kpowersave
This enables both Qt3 and Qt4 builds git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kpowersave@1228282 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/logviewer.cpp')
-rw-r--r--src/logviewer.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/logviewer.cpp b/src/logviewer.cpp
index cb4d333..6e09db4 100644
--- a/src/logviewer.cpp
+++ b/src/logviewer.cpp
@@ -25,8 +25,8 @@
*/
// QT header
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
// KDE header
#include <ktextedit.h>
@@ -38,19 +38,19 @@
#include "logviewer.h"
/*! This is the default constructor of the class LogViewer. */
-LogViewer::LogViewer( QString filename, QWidget *parent, const char *name)
- :log_viewer(parent, name, false, WDestructiveClose ) {
+LogViewer::LogViewer( TQString filename, TQWidget *tqparent, const char *name)
+ :log_viewer(tqparent, name, false, WDestructiveClose ) {
- this->setCaption(i18n("KPowersave Logfile Viewer: %1").arg(filename));
+ this->setCaption(i18n("KPowersave Logfile Viewer: %1").tqarg(filename));
- if (!QFile::exists ( filename ))
+ if (!TQFile::exists ( filename ))
return;
log_file = filename;
- QFile file (log_file);
+ TQFile file (log_file);
if (file.open(IO_ReadOnly)) {
- QTextStream stream ( &file );
+ TQTextStream stream ( &file );
kTextEdit->setText (stream.read());
kTextEdit->setReadOnly(true);
}
@@ -59,7 +59,7 @@ LogViewer::LogViewer( QString filename, QWidget *parent, const char *name)
/*! This is the default destructor of the class LogViewer. */
LogViewer::~LogViewer(){
- // no need to delete child widgets, Qt does it all for us
+ // no need to delete child widgets, TQt does it all for us
}
/*!
@@ -75,23 +75,23 @@ void LogViewer::pB_close_clicked() {
*/
void LogViewer::pB_save_clicked() {
- QString sFileName;
+ TQString sFileName;
bool tryagain = true;
while (tryagain == true) {
int answer;
- QString msg;
+ TQString msg;
- sFileName = KFileDialog::getSaveFileName( QDir::homeDirPath() );
- QFileInfo info (sFileName);
+ sFileName = KFileDialog::getSaveFileName( TQDir::homeDirPath() );
+ TQFileInfo info (sFileName);
- if (QFile::exists(sFileName) && info.isWritable() && info.isReadable() && info.isFile()) {
+ if (TQFile::exists(sFileName) && info.isWritable() && info.isReadable() && info.isFile()) {
msg = i18n("File already exist. Overwrite the file?");
answer = KMessageBox::questionYesNo(this, msg , i18n("Error while save logfile"));
if (answer == KMessageBox::Yes) {
tryagain = false;
}
- } else if (QFile::exists(sFileName)) {
+ } else if (TQFile::exists(sFileName)) {
msg = i18n("File already exist.");
answer = KMessageBox::warningContinueCancel(this, msg ,
i18n("Error while save logfile"),
@@ -105,11 +105,11 @@ void LogViewer::pB_save_clicked() {
}
}
- QFile in(log_file);
- QFile out(sFileName);
+ TQFile in(log_file);
+ TQFile out(sFileName);
if (in.open(IO_ReadOnly)) {
if (out.open(IO_WriteOnly)) {
- QByteArray input(4096);
+ TQByteArray input(4096);
long l = 0;
while (!in.atEnd()) {
l = in.readLine(input.data(), 4096);