summaryrefslogtreecommitdiffstats
path: root/src/kchmsettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kchmsettings.cpp')
-rw-r--r--src/kchmsettings.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/src/kchmsettings.cpp b/src/kchmsettings.cpp
index dcdcffa..bc9f354 100644
--- a/src/kchmsettings.cpp
+++ b/src/kchmsettings.cpp
@@ -19,15 +19,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qdatastream.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqdatastream.h>
#include "kchmsettings.h"
#include "kchmconfig.h"
-static Q_INT32 SETTINGS_MAGIC = 0xD8AB4E76;
-static Q_INT32 SETTINGS_VERSION = 4;
+static TQ_INT32 SETTINGS_MAGIC = 0xD8AB4E76;
+static TQ_INT32 SETTINGS_VERSION = 4;
/*
* The order is important!
@@ -54,8 +54,8 @@ enum marker_t
MARKER_END = 0x7FFF
};
-// Helpers for serialization of SavedBookmark through QDataStream
-static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::SavedBookmark& b )
+// Helpers for serialization of SavedBookmark through TQDataStream
+static inline TQDataStream& operator<< ( TQDataStream& s, const KCHMSettings::SavedBookmark& b )
{
s << b.name;
s << b.url;
@@ -63,7 +63,7 @@ static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::Save
return s;
}
-static inline QDataStream& operator>> ( QDataStream& s, KCHMSettings::SavedBookmark& b )
+static inline TQDataStream& operator>> ( TQDataStream& s, KCHMSettings::SavedBookmark& b )
{
s >> b.name;
s >> b.url;
@@ -71,8 +71,8 @@ static inline QDataStream& operator>> ( QDataStream& s, KCHMSettings::SavedBookm
return s;
}
-// Helpers for serialization of SavedViewWindow through QDataStream
-static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::SavedViewWindow& b )
+// Helpers for serialization of SavedViewWindow through TQDataStream
+static inline TQDataStream& operator<< ( TQDataStream& s, const KCHMSettings::SavedViewWindow& b )
{
// Store the version first. Later we can increase it when adding new members.
s << 1;
@@ -82,9 +82,9 @@ static inline QDataStream& operator<< ( QDataStream& s, const KCHMSettings::Save
return s;
}
-static inline QDataStream& operator>> ( QDataStream& s, KCHMSettings::SavedViewWindow& b )
+static inline TQDataStream& operator>> ( TQDataStream& s, KCHMSettings::SavedViewWindow& b )
{
- Q_INT32 version;
+ TQ_INT32 version;
s >> version;
s >> b.url;
@@ -106,7 +106,7 @@ KCHMSettings::KCHMSettings( )
}
-bool KCHMSettings::loadSettings( const QString & filename )
+bool KCHMSettings::loadSettings( const TQString & filename )
{
m_activetabsystem = 0;
m_activetabwindow = 0;
@@ -116,11 +116,11 @@ bool KCHMSettings::loadSettings( const QString & filename )
m_bookmarks.clear();
m_viewwindows.clear();
- QFileInfo finfo ( filename );
+ TQFileInfo finfo ( filename );
- m_settingsFile = QString::null;
- m_searchDictFile = QString::null;
- m_searchDocFile = QString::null;
+ m_settingsFile = TQString();
+ m_searchDictFile = TQString();
+ m_searchDocFile = TQString();
if ( !finfo.size() )
return false;
@@ -131,15 +131,15 @@ bool KCHMSettings::loadSettings( const QString & filename )
getFilenames( filename, &m_settingsFile, &m_searchDictFile, &m_searchDocFile );
- QFile file( m_settingsFile );
+ TQFile file( m_settingsFile );
if ( !file.open (IO_ReadOnly) )
return false; // it's ok, file may not exist
- QDataStream stream (&file);
+ TQDataStream stream (&file);
// Read and check header
- Q_INT32 data;
+ TQ_INT32 data;
bool complete_read = false;
stream >> data; // magic
@@ -224,14 +224,14 @@ bool KCHMSettings::loadSettings( const QString & filename )
bool KCHMSettings::saveSettings( )
{
- QFile file( m_settingsFile );
+ TQFile file( m_settingsFile );
if ( !file.open (IO_WriteOnly) )
{
- qWarning ("Could not write settings into file %s: %s", file.name().ascii(), file.errorString().ascii());
+ qWarning ("Could not write settings into file %s: %s", TQString(file.name()).ascii(), TQString(file.errorString()).ascii());
return false;
}
- QDataStream stream (&file);
+ TQDataStream stream (&file);
// Save header
stream << SETTINGS_MAGIC;
@@ -275,22 +275,22 @@ bool KCHMSettings::saveSettings( )
}
-void KCHMSettings::removeSettings( const QString & filename )
+void KCHMSettings::removeSettings( const TQString & filename )
{
- QString settingsfile, dictfile, doclistfile;
+ TQString settingsfile, dictfile, doclistfile;
getFilenames( filename, &settingsfile, &dictfile, &doclistfile );
- QFile::remove( settingsfile );
- QFile::remove( dictfile );
- QFile::remove( doclistfile );
+ TQFile::remove( settingsfile );
+ TQFile::remove( dictfile );
+ TQFile::remove( doclistfile );
}
-void KCHMSettings::getFilenames(const QString & helpfilename, QString * settingsfile, QString * dictfile, QString * doclistfile )
+void KCHMSettings::getFilenames(const TQString & helpfilename, TQString * settingsfile, TQString * dictfile, TQString * doclistfile )
{
- QFileInfo finfo ( helpfilename );
- QString prefix = appConfig.m_datapath + "/" + finfo.baseName();
+ TQFileInfo finfo ( helpfilename );
+ TQString prefix = appConfig.m_datapath + "/" + finfo.baseName();
*settingsfile = prefix + ".kchmviewer";
*dictfile = prefix + ".dict";