diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kate/plugins/insertfile/insertfileplugin.cpp | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/plugins/insertfile/insertfileplugin.cpp')
-rw-r--r-- | kate/plugins/insertfile/insertfileplugin.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/kate/plugins/insertfile/insertfileplugin.cpp b/kate/plugins/insertfile/insertfileplugin.cpp index e25df8bd5..6a350831f 100644 --- a/kate/plugins/insertfile/insertfileplugin.cpp +++ b/kate/plugins/insertfile/insertfileplugin.cpp @@ -34,14 +34,14 @@ #include <ktempfile.h> #include <kurl.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> K_EXPORT_COMPONENT_FACTORY( ktexteditor_insertfile, KGenericFactory<InsertFilePlugin>( "ktexteditor_insertfile" ) ) //BEGIN InsertFilePlugin -InsertFilePlugin::InsertFilePlugin( QObject *parent, const char* name, const QStringList& ) +InsertFilePlugin::InsertFilePlugin( TQObject *parent, const char* name, const TQStringList& ) : KTextEditor::Plugin ( (KTextEditor::Document*) parent, name ) { } @@ -70,19 +70,19 @@ void InsertFilePlugin::removeView(KTextEditor::View *view) //BEGIN InsertFilePluginView InsertFilePluginView::InsertFilePluginView( KTextEditor::View *view, const char *name ) - : QObject( view, name ), + : TQObject( view, name ), KXMLGUIClient( view ) { view->insertChildClient( this ); setInstance( KGenericFactory<InsertFilePlugin>::instance() ); _job = 0; - (void) new KAction( i18n("Insert File..."), 0, this, SLOT(slotInsertFile()), actionCollection(), "tools_insert_file" ); + (void) new KAction( i18n("Insert File..."), 0, this, TQT_SLOT(slotInsertFile()), actionCollection(), "tools_insert_file" ); setXMLFile( "ktexteditor_insertfileui.rc" ); } void InsertFilePluginView::slotInsertFile() { - KFileDialog dlg("::insertfile", "", (QWidget*)parent(), "filedialog", true); + KFileDialog dlg("::insertfile", "", (TQWidget*)parent(), "filedialog", true); dlg.setOperationMode( KFileDialog::Opening ); dlg.setCaption(i18n("Choose File to Insert")); @@ -98,13 +98,13 @@ void InsertFilePluginView::slotInsertFile() insertFile(); } else { - KTempFile tempFile( QString::null ); + KTempFile tempFile( TQString::null ); _tmpfile = tempFile.name(); KURL destURL; destURL.setPath( _tmpfile ); _job = KIO::file_copy( _file, destURL, 0600, true, false, true ); - connect( _job, SIGNAL( result( KIO::Job * ) ), this, SLOT( slotFinished ( KIO::Job * ) ) ); + connect( _job, TQT_SIGNAL( result( KIO::Job * ) ), this, TQT_SLOT( slotFinished ( KIO::Job * ) ) ); } } @@ -113,34 +113,34 @@ void InsertFilePluginView::slotFinished( KIO::Job *job ) assert( job == _job ); _job = 0; if ( job->error() ) - KMessageBox::error( (QWidget*)parent(), i18n("Failed to load file:\n\n") + job->errorString(), i18n("Insert File Error") ); + KMessageBox::error( (TQWidget*)parent(), i18n("Failed to load file:\n\n") + job->errorString(), i18n("Insert File Error") ); else insertFile(); } void InsertFilePluginView::insertFile() { - QString error; + TQString error; if ( _tmpfile.isEmpty() ) return; - QFileInfo fi; + TQFileInfo fi; fi.setFile( _tmpfile ); if (!fi.exists() || !fi.isReadable()) error = i18n("<p>The file <strong>%1</strong> does not exist or is not readable, aborting.").arg(_file.fileName()); - QFile f( _tmpfile ); + TQFile f( _tmpfile ); if ( !f.open(IO_ReadOnly) ) error = i18n("<p>Unable to open file <strong>%1</strong>, aborting.").arg(_file.fileName()); if ( ! error.isEmpty() ) { - KMessageBox::sorry( (QWidget*)parent(), error, i18n("Insert File Error") ); + KMessageBox::sorry( (TQWidget*)parent(), error, i18n("Insert File Error") ); return; } // now grab file contents - QTextStream stream(&f); - QString str, tmp; + TQTextStream stream(&f); + TQString str, tmp; uint numlines = 0; uint len = 0; while (!stream.eof()) { @@ -156,7 +156,7 @@ void InsertFilePluginView::insertFile() if ( str.isEmpty() ) error = i18n("<p>File <strong>%1</strong> had no contents.").arg(_file.fileName()); if ( ! error.isEmpty() ) { - KMessageBox::sorry( (QWidget*)parent(), error, i18n("Insert File Error") ); + KMessageBox::sorry( (TQWidget*)parent(), error, i18n("Insert File Error") ); return; } |