summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/sourcefile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/sourcefile.cpp')
-rw-r--r--kdevdesigner/designer/sourcefile.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kdevdesigner/designer/sourcefile.cpp b/kdevdesigner/designer/sourcefile.cpp
index 327dc58c..8e103e85 100644
--- a/kdevdesigner/designer/sourcefile.cpp
+++ b/kdevdesigner/designer/sourcefile.cpp
@@ -25,14 +25,14 @@
**********************************************************************/
#include "sourcefile.h"
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#include "designerappiface.h"
#include "sourceeditor.h"
#include "metadatabase.h"
#include "../interfaces/languageinterface.h"
-#include <qfiledialog.h>
-#include <qmessagebox.h>
+#include <tqfiledialog.h>
+#include <tqmessagebox.h>
#include "mainwindow.h"
#include "workspace.h"
#include <stdlib.h>
@@ -40,7 +40,7 @@
#include <kfiledialog.h>
#include <klocale.h>
-SourceFile::SourceFile( const QString &fn, bool temp, Project *p )
+SourceFile::SourceFile( const TQString &fn, bool temp, Project *p )
: filename( fn ), ed( 0 ), fileNameTemp( temp ),
timeStamp( 0, p->makeAbsolute( fn ) ), pro( p ), pkg( FALSE )
, accepted( TRUE )
@@ -64,12 +64,12 @@ SourceFile::~SourceFile()
delete iface;
}
-QString SourceFile::text() const
+TQString SourceFile::text() const
{
return txt;
}
-void SourceFile::setText( const QString &s )
+void SourceFile::setText( const TQString &s )
{
txt = s;
}
@@ -83,29 +83,29 @@ bool SourceFile::save( bool ignoreModified )
if ( ed )
ed->save();
- if ( QFile::exists( pro->makeAbsolute( filename ) ) ) {
- QString fn( pro->makeAbsolute( filename ) );
+ if ( TQFile::exists( pro->makeAbsolute( filename ) ) ) {
+ TQString fn( pro->makeAbsolute( filename ) );
#if defined(Q_OS_WIN32)
fn += ".bak";
#else
fn += "~";
#endif
- QFile f( pro->makeAbsolute( filename ) );
+ TQFile f( pro->makeAbsolute( filename ) );
if ( f.open( IO_ReadOnly ) ) {
- QFile f2( fn );
+ TQFile f2( fn );
if ( f2.open( IO_WriteOnly | IO_Translate ) ) {
- QCString data( f.size() );
+ TQCString data( f.size() );
f.readBlock( data.data(), f.size() );
f2.writeBlock( data );
}
}
}
- QFile f( pro->makeAbsolute( filename ) );
+ TQFile f( pro->makeAbsolute( filename ) );
if ( !f.open( IO_WriteOnly | IO_Translate ) )
return saveAs();
- QTextStream ts( &f );
+ TQTextStream ts( &f );
ts << txt;
timeStamp.update();
setModified( FALSE );
@@ -115,18 +115,18 @@ bool SourceFile::save( bool ignoreModified )
bool SourceFile::saveAs( bool ignoreModified )
{
LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
- QString filter;
+ TQString filter;
if ( iface )
filter = iface->fileFilterList().join("\n");
- QString old = filename;
- QString initFn = pro->makeAbsolute( filename );
+ TQString old = filename;
+ TQString initFn = pro->makeAbsolute( filename );
if ( ignoreModified ) {
- QString dir = QStringList::split( ':', project()->iFace()->customSetting( "QTSCRIPT_PACKAGES" ) ).first();
- initFn = QFileInfo( initFn ).fileName();
+ TQString dir = TQStringList::split( ':', project()->iFace()->customSetting( "QTSCRIPT_PACKAGES" ) ).first();
+ initFn = TQFileInfo( initFn ).fileName();
initFn.prepend( dir + "/" );
}
- QString fn = KFileDialog::getSaveFileName( initFn, filter );
+ TQString fn = KFileDialog::getSaveFileName( initFn, filter );
if ( fn.isEmpty() )
return FALSE;
fileNameTemp = FALSE;
@@ -141,7 +141,7 @@ bool SourceFile::saveAs( bool ignoreModified )
ed->setCaption( i18n( "Edit %1" ).arg( filename ) );
setModified( TRUE );
if ( pro->isDummy() ) {
- QObject *o = ed->parent();
+ TQObject *o = ed->parent();
while ( o && !o->isA( "MainWindow" ) )
o = o->parent();
if ( o )
@@ -152,10 +152,10 @@ bool SourceFile::saveAs( bool ignoreModified )
bool SourceFile::load()
{
- QFile f( pro->makeAbsolute( filename ) );
+ TQFile f( pro->makeAbsolute( filename ) );
if ( !f.open( IO_ReadOnly ) )
return FALSE;
- QTextStream ts( &f );
+ TQTextStream ts( &f );
txt = ts.read();
timeStamp.update();
return TRUE;
@@ -180,13 +180,13 @@ bool SourceFile::isModified() const
return ed->isModified();
}
-static QMap<QString, int> *extensionCounter;
-QString SourceFile::createUnnamedFileName( const QString &extension )
+static TQMap<TQString, int> *extensionCounter;
+TQString SourceFile::createUnnamedFileName( const TQString &extension )
{
if ( !extensionCounter )
- extensionCounter = new QMap<QString, int>;
+ extensionCounter = new TQMap<TQString, int>;
int count = -1;
- QMap<QString, int>::Iterator it;
+ TQMap<TQString, int>::Iterator it;
if ( ( it = extensionCounter->find( extension ) ) != extensionCounter->end() ) {
count = *it;
++count;
@@ -196,7 +196,7 @@ QString SourceFile::createUnnamedFileName( const QString &extension )
extensionCounter->insert( extension, count );
}
- return "unnamed" + QString::number( count ) + "." + extension;
+ return "unnamed" + TQString::number( count ) + "." + extension;
}
void SourceFile::setModified( bool m )
@@ -219,7 +219,7 @@ bool SourceFile::closeEvent()
if ( ed )
ed->save();
- switch ( QMessageBox::warning( MainWindow::self, i18n( "Save Code" ),
+ switch ( TQMessageBox::warning( MainWindow::self, i18n( "Save Code" ),
i18n( "Save changes to '%1'?" ).arg( filename ),
i18n( "&Yes" ), i18n( "&No" ), i18n( "&Cancel" ), 0, 2 ) ) {
case 0: // save
@@ -263,7 +263,7 @@ void SourceFile::checkTimeStamp()
if ( timeStamp.isUpToDate() )
return;
timeStamp.update();
- if ( QMessageBox::information( MainWindow::self, i18n( "Qt Designer" ),
+ if ( TQMessageBox::information( MainWindow::self, i18n( "Qt Designer" ),
i18n( "File '%1' has been changed outside Qt Designer.\n"
"Do you want to reload it?" ).arg( filename ),
i18n( "&Yes" ), i18n( "&No" ) ) == 0 ) {
@@ -277,15 +277,15 @@ bool SourceFile::checkFileName( bool allowBreak )
{
SourceFile *sf = pro->findSourceFile( filename, this );
if ( sf )
- QMessageBox::warning( MainWindow::self, i18n( "Invalid Filename" ),
+ TQMessageBox::warning( MainWindow::self, i18n( "Invalid Filename" ),
i18n( "The project already contains a source file with \n"
"filename '%1'. Please choose a new filename." ).arg( filename ) );
while ( sf ) {
LanguageInterface *iface = MetaDataBase::languageInterface( pro->language() );
- QString filter;
+ TQString filter;
if ( iface )
filter = iface->fileFilterList().join("\n");
- QString fn;
+ TQString fn;
while ( fn.isEmpty() ) {
fn = KFileDialog::getSaveFileName( pro->makeAbsolute( filename ), filter );
if ( allowBreak && fn.isEmpty() )