summaryrefslogtreecommitdiffstats
path: root/knotes/knoteslegacy.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /knotes/knoteslegacy.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knotes/knoteslegacy.cpp')
-rw-r--r--knotes/knoteslegacy.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/knotes/knoteslegacy.cpp b/knotes/knoteslegacy.cpp
index 1d239d2d..8cb57d4c 100644
--- a/knotes/knoteslegacy.cpp
+++ b/knotes/knoteslegacy.cpp
@@ -18,12 +18,12 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*******************************************************************/
-#include <qfile.h>
-#include <qfont.h>
-#include <qpoint.h>
-#include <qcolor.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqfont.h>
+#include <tqpoint.h>
+#include <tqcolor.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
#include <kdebug.h>
#include <kapplication.h>
@@ -50,8 +50,8 @@ using namespace KCal;
void KNotesLegacy::cleanUp()
{
// remove old (KDE 1.x) local config file if it still exists
- QString configfile = KGlobal::dirs()->saveLocation( "config" ) + "knotesrc";
- if ( QFile::exists( configfile ) ) {
+ TQString configfile = KGlobal::dirs()->saveLocation( "config" ) + "knotesrc";
+ if ( TQFile::exists( configfile ) ) {
KSimpleConfig *test = new KSimpleConfig( configfile );
test->setGroup( "General" );
double version = test->readDoubleNumEntry( "version", 1.0 );
@@ -59,7 +59,7 @@ void KNotesLegacy::cleanUp()
if ( version == 1.0 ) {
if ( !( checkAccess( configfile, W_OK ) &&
- QFile::remove( configfile ) ) )
+ TQFile::remove( configfile ) ) )
{
kdError(5500) << k_funcinfo << "Could not delete old config file " << configfile << endl;
}
@@ -71,11 +71,11 @@ bool KNotesLegacy::convert( CalendarLocal *calendar )
{
bool converted = false;
- QDir noteDir( KGlobal::dirs()->saveLocation( "appdata", "notes/" ) );
- QStringList notes = noteDir.entryList( QDir::Files, QDir::Name );
- for ( QStringList::Iterator note = notes.begin(); note != notes.end(); note++ )
+ TQDir noteDir( KGlobal::dirs()->saveLocation( "appdata", "notes/" ) );
+ TQStringList notes = noteDir.entryList( TQDir::Files, TQDir::Name );
+ for ( TQStringList::Iterator note = notes.begin(); note != notes.end(); note++ )
{
- QString file = noteDir.absFilePath( *note );
+ TQString file = noteDir.absFilePath( *note );
KSimpleConfig* test = new KSimpleConfig( file );
test->setGroup( "General" );
double version = test->readDoubleNumEntry( "version", 1.0 );
@@ -116,10 +116,10 @@ bool KNotesLegacy::convert( CalendarLocal *calendar )
return converted;
}
-bool KNotesLegacy::convertKNotes1Config( Journal *journal, QDir& noteDir,
- const QString& file )
+bool KNotesLegacy::convertKNotes1Config( Journal *journal, TQDir& noteDir,
+ const TQString& file )
{
- QFile infile( noteDir.absFilePath( file ) );
+ TQFile infile( noteDir.absFilePath( file ) );
if ( !infile.open( IO_ReadOnly ) )
{
kdError(5500) << k_funcinfo << "Could not open input file: \""
@@ -127,12 +127,12 @@ bool KNotesLegacy::convertKNotes1Config( Journal *journal, QDir& noteDir,
return false;
}
- QTextStream input( &infile );
+ TQTextStream input( &infile );
// get the name
journal->setSummary( input.readLine() );
- QStringList props = QStringList::split( '+', input.readLine() );
+ TQStringList props = TQStringList::split( '+', input.readLine() );
// robustness
if ( props.count() != 13 )
@@ -144,7 +144,7 @@ bool KNotesLegacy::convertKNotes1Config( Journal *journal, QDir& noteDir,
}
// the new configfile's name
- QString configFile = noteDir.absFilePath( journal->uid() );
+ TQString configFile = noteDir.absFilePath( journal->uid() );
// set the defaults
KIO::NetAccess::copy(
@@ -165,23 +165,23 @@ bool KNotesLegacy::convertKNotes1Config( Journal *journal, QDir& noteDir,
uint red = input.readLine().toUInt();
uint green = input.readLine().toUInt();
uint blue = input.readLine().toUInt();
- config.setBgColor( QColor( red, green, blue ) );
+ config.setBgColor( TQColor( red, green, blue ) );
// get the foreground color
red = input.readLine().toUInt();
green = input.readLine().toUInt();
blue = input.readLine().toUInt();
- config.setFgColor( QColor( red, green, blue ) );
+ config.setFgColor( TQColor( red, green, blue ) );
// get the font
- QString fontfamily = input.readLine();
+ TQString fontfamily = input.readLine();
if ( fontfamily.isEmpty() )
- fontfamily = QString( "Sans Serif" );
+ fontfamily = TQString( "Sans Serif" );
uint size = input.readLine().toUInt();
size = QMAX( size, 4 );
uint weight = input.readLine().toUInt();
bool italic = ( input.readLine().toUInt() == 1 );
- QFont font( fontfamily, size, weight, italic );
+ TQFont font( fontfamily, size, weight, italic );
config.setTitleFont( font );
config.setFont( font );
@@ -204,13 +204,13 @@ bool KNotesLegacy::convertKNotes1Config( Journal *journal, QDir& noteDir,
note_desktop = NETWinInfo::OnAllDesktops;
config.setDesktop( note_desktop );
- config.setPosition( QPoint( props[1].toUInt(), props[2].toUInt() ) );
+ config.setPosition( TQPoint( props[1].toUInt(), props[2].toUInt() ) );
config.setKeepAbove( props[12].toUInt() & 2048 );
config.writeConfig();
// get the text
- QString text;
+ TQString text;
while ( !input.atEnd() )
{
text.append( input.readLine() );
@@ -226,10 +226,10 @@ bool KNotesLegacy::convertKNotes1Config( Journal *journal, QDir& noteDir,
return true;
}
-bool KNotesLegacy::convertKNotes2Config( Journal *journal, QDir& noteDir,
- const QString& file )
+bool KNotesLegacy::convertKNotes2Config( Journal *journal, TQDir& noteDir,
+ const TQString& file )
{
- QString configFile = noteDir.absFilePath( journal->uid() );
+ TQString configFile = noteDir.absFilePath( journal->uid() );
// new name for config file
if ( !noteDir.rename( file, journal->uid() ) )
@@ -254,11 +254,11 @@ bool KNotesLegacy::convertKNotes2Config( Journal *journal, QDir& noteDir,
config.deleteEntry( "state" );
// load the saved text and put it in the journal
- QFile infile( noteDir.absFilePath( "." + file + "_data" ) );
+ TQFile infile( noteDir.absFilePath( "." + file + "_data" ) );
if ( infile.open( IO_ReadOnly ) )
{
- QTextStream input( &infile );
- input.setEncoding( QTextStream::UnicodeUTF8 );
+ TQTextStream input( &infile );
+ input.setEncoding( TQTextStream::UnicodeUTF8 );
journal->setDescription( input.read() );
if ( !infile.remove() )
kdWarning(5500) << k_funcinfo << "Could not delete data file: \"" << infile.name() << "\"" << endl;