diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kompare/kompare_shell.cpp | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kompare/kompare_shell.cpp')
-rw-r--r-- | kompare/kompare_shell.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/kompare/kompare_shell.cpp b/kompare/kompare_shell.cpp index 3840e272..66bf89d2 100644 --- a/kompare/kompare_shell.cpp +++ b/kompare/kompare_shell.cpp @@ -61,14 +61,14 @@ KompareShell::KompareShell() setupStatusBar(); KTrader::OfferList offers = KTrader::self()->query( "text/x-diff", - "Kompare/ViewPart", QString::null, QString::null ); + "Kompare/ViewPart", TQString::null, TQString::null ); #ifdef NDEBUG for( int i = 0; i < offers.count(); i++ ) { kdDebug(8102) << "One kservicetype checked..." << endl; KService::Ptr ptr2 = *(offers.at( i )); - QStringList list = ptr2->serviceTypes(); - for ( QStringList::Iterator it2 = list.begin(); it2 != list.end(); ++it2 ) + TQStringList list = ptr2->serviceTypes(); + for ( TQStringList::Iterator it2 = list.begin(); it2 != list.end(); ++it2 ) kdDebug(8102) << *it2 << endl; } #endif @@ -108,7 +108,7 @@ KompareShell::KompareShell() } offers.clear(); - offers = KTrader::self()->query( "text/x-diff", "KParts/ReadOnlyPart", "'Kompare/NavigationPart' in ServiceTypes", QString::null ); + offers = KTrader::self()->query( "text/x-diff", "KParts/ReadOnlyPart", "'Kompare/NavigationPart' in ServiceTypes", TQString::null ); if ( offers.count() == 0 ) { KMessageBox::error(this, i18n( "Could not find our KompareNavigationPart." ) ); @@ -140,21 +140,21 @@ KompareShell::KompareShell() } // Hook up the inter part communication - connect( m_viewPart, SIGNAL( modelsChanged(const Diff2::DiffModelList*) ), - m_navTreePart, SLOT( slotModelsChanged( const Diff2::DiffModelList*) ) ); + connect( m_viewPart, TQT_SIGNAL( modelsChanged(const Diff2::DiffModelList*) ), + m_navTreePart, TQT_SLOT( slotModelsChanged( const Diff2::DiffModelList*) ) ); - connect( m_viewPart, SIGNAL( kompareInfo(Kompare::Info*) ), - m_navTreePart, SLOT( slotKompareInfo(Kompare::Info*) ) ); + connect( m_viewPart, TQT_SIGNAL( kompareInfo(Kompare::Info*) ), + m_navTreePart, TQT_SLOT( slotKompareInfo(Kompare::Info*) ) ); - connect( m_navTreePart, SIGNAL( selectionChanged(const Diff2::DiffModel*, const Diff2::Difference*) ), - m_viewPart, SIGNAL( selectionChanged(const Diff2::DiffModel*, const Diff2::Difference*) ) ); - connect( m_viewPart, SIGNAL( setSelection(const Diff2::DiffModel*, const Diff2::Difference*) ), - m_navTreePart, SLOT( slotSetSelection(const Diff2::DiffModel*, const Diff2::Difference*) ) ); + connect( m_navTreePart, TQT_SIGNAL( selectionChanged(const Diff2::DiffModel*, const Diff2::Difference*) ), + m_viewPart, TQT_SIGNAL( selectionChanged(const Diff2::DiffModel*, const Diff2::Difference*) ) ); + connect( m_viewPart, TQT_SIGNAL( setSelection(const Diff2::DiffModel*, const Diff2::Difference*) ), + m_navTreePart, TQT_SLOT( slotSetSelection(const Diff2::DiffModel*, const Diff2::Difference*) ) ); - connect( m_navTreePart, SIGNAL( selectionChanged(const Diff2::Difference*) ), - m_viewPart, SIGNAL( selectionChanged(const Diff2::Difference*) ) ); - connect( m_viewPart, SIGNAL( setSelection(const Diff2::Difference*) ), - m_navTreePart, SLOT( slotSetSelection(const Diff2::Difference*) ) ); + connect( m_navTreePart, TQT_SIGNAL( selectionChanged(const Diff2::Difference*) ), + m_viewPart, TQT_SIGNAL( selectionChanged(const Diff2::Difference*) ) ); + connect( m_viewPart, TQT_SIGNAL( setSelection(const Diff2::Difference*) ), + m_navTreePart, TQT_SLOT( slotSetSelection(const Diff2::Difference*) ) ); // This is the interpart interface, it is signal and slot based so no "real" nterface here // All you have to do is connect the parts from your application. @@ -162,18 +162,18 @@ KompareShell::KompareShell() // from the method with the same name in KompareModelList. // There is currently no applying possible from the navtreepart to the viewpart - connect( m_viewPart, SIGNAL(applyDifference(bool)), - m_navTreePart, SLOT(slotApplyDifference(bool)) ); - connect( m_viewPart, SIGNAL(applyAllDifferences(bool)), - m_navTreePart, SLOT(slotApplyAllDifferences(bool)) ); - connect( m_viewPart, SIGNAL(applyDifference(const Diff2::Difference*, bool)), - m_navTreePart, SLOT(slotApplyDifference(const Diff2::Difference*, bool)) ); + connect( m_viewPart, TQT_SIGNAL(applyDifference(bool)), + m_navTreePart, TQT_SLOT(slotApplyDifference(bool)) ); + connect( m_viewPart, TQT_SIGNAL(applyAllDifferences(bool)), + m_navTreePart, TQT_SLOT(slotApplyAllDifferences(bool)) ); + connect( m_viewPart, TQT_SIGNAL(applyDifference(const Diff2::Difference*, bool)), + m_navTreePart, TQT_SLOT(slotApplyDifference(const Diff2::Difference*, bool)) ); // Hook up the KomparePart -> KompareShell communication - connect( m_viewPart, SIGNAL( setStatusBarModelInfo( int, int, int, int, int ) ), - this, SLOT( slotUpdateStatusBar( int, int, int, int, int ) ) ); - connect( m_viewPart, SIGNAL( setStatusBarText(const QString&) ), - this, SLOT( slotSetStatusBarText(const QString&) ) ); + connect( m_viewPart, TQT_SIGNAL( setStatusBarModelInfo( int, int, int, int, int ) ), + this, TQT_SLOT( slotUpdateStatusBar( int, int, int, int, int ) ) ); + connect( m_viewPart, TQT_SIGNAL( setStatusBarText(const TQString&) ), + this, TQT_SLOT( slotSetStatusBarText(const TQString&) ) ); // Read basic main-view settings, and set to autosave setAutoSaveSettings( "General Options" ); @@ -198,11 +198,11 @@ void KompareShell::openDiff(const KURL& url) void KompareShell::openStdin() { kdDebug(8102) << "Using stdin to read the diff" << endl; - QFile file; + TQFile file; file.open( IO_ReadOnly, stdin ); - QTextStream stream( &file ); + TQTextStream stream( &file ); - QString diff = stream.read(); + TQString diff = stream.read(); file.close(); @@ -228,26 +228,26 @@ void KompareShell::blend( const KURL& url1, const KURL& diff ) void KompareShell::setupActions() { - KAction* open = KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); + KAction* open = KStdAction::open(this, TQT_SLOT(slotFileOpen()), actionCollection()); open->setText( i18n( "&Open Diff..." ) ); new KAction( i18n("&Compare Files..."), "fileopen", Qt::CTRL + Qt::Key_C, - this, SLOT(slotFileCompareFiles()), + this, TQT_SLOT(slotFileCompareFiles()), actionCollection(), "file_compare_files" ); new KAction( i18n("&Blend URL with Diff..."), "fileblend", Qt::CTRL + Qt::Key_B, - this, SLOT(slotFileBlendURLAndDiff()), + this, TQT_SLOT(slotFileBlendURLAndDiff()), actionCollection(), "file_blend_url" ); - KStdAction::quit( this, SLOT( slotFileClose() ), actionCollection() ); + KStdAction::quit( this, TQT_SLOT( slotFileClose() ), actionCollection() ); #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,90) createStandardStatusBarAction(); #endif setStandardToolBarMenuEnabled(true); - m_showTextView = new KToggleAction( i18n("Show T&ext View"), 0, this, SLOT(slotShowTextView()), + m_showTextView = new KToggleAction( i18n("Show T&ext View"), 0, this, TQT_SLOT(slotShowTextView()), actionCollection(), "options_show_text_view" ); m_showTextView->setCheckedState(i18n("Hide T&ext View")); - KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::keyBindings(this, TQT_SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), actionCollection()); } void KompareShell::setupStatusBar() @@ -265,8 +265,8 @@ void KompareShell::slotUpdateStatusBar( int modelIndex, int differenceIndex, int { kdDebug(8102) << "KompareShell::updateStatusBar()" << endl; - QString fileStr; - QString diffStr; + TQString fileStr; + TQString diffStr; if ( modelIndex >= 0 ) fileStr = i18n( " %1 of %n file ", " %1 of %n files ", modelCount ).arg( modelIndex + 1 ); @@ -283,12 +283,12 @@ void KompareShell::slotUpdateStatusBar( int modelIndex, int differenceIndex, int statusBar()->changeItem( diffStr, ID_N_OF_N_DIFFERENCES ); } -void KompareShell::slotSetStatusBarText( const QString& text ) +void KompareShell::slotSetStatusBarText( const TQString& text ) { m_generalLabel->setText( text ); } -void KompareShell::setCaption( const QString& caption ) +void KompareShell::setCaption( const TQString& caption ) { // kdDebug() << kdBacktrace(); KParts::DockMainWindow::setCaption( caption, m_viewPart->isModified() ); @@ -321,7 +321,7 @@ void KompareShell::readProperties(KConfig* config) // the app is being restored. Read in here whatever you wrote // in 'saveProperties' - QString mode = config->readEntry( "Mode", "ComparingFiles" ); + TQString mode = config->readEntry( "Mode", "ComparingFiles" ); if ( mode == "ComparingFiles" ) { m_mode = Kompare::ComparingFiles; @@ -352,7 +352,7 @@ void KompareShell::readProperties(KConfig* config) void KompareShell::slotFileOpen() { // FIXME: use different filedialog which gets encoding - KURL url = KFileDialog::getOpenURL( QString::null, "text/x-diff", this ); + KURL url = KFileDialog::getOpenURL( TQString::null, "text/x-diff", this ); if( !url.isEmpty() ) { KompareShell* shell = new KompareShell(); kapp->ref(); @@ -369,7 +369,7 @@ void KompareShell::slotFileBlendURLAndDiff() dialog->setFirstGroupBoxTitle( i18n( "File/Folder" ) ); dialog->setSecondGroupBoxTitle( i18n( "Diff Output" ) ); - KGuiItem blendGuiItem( i18n( "Blend" ), QString::null, i18n( "Blend this file or folder with the diff output" ), i18n( "If you have entered a file or folder name and a file that contains diff output in the fields in this dialog then this button will be enabled and pressing it will open kompare's main view where the output of the entered file or files from the folder are mixed with the diff output so you can then apply the difference(s) to a file or to the files. " ) ); + KGuiItem blendGuiItem( i18n( "Blend" ), TQString::null, i18n( "Blend this file or folder with the diff output" ), i18n( "If you have entered a file or folder name and a file that contains diff output in the fields in this dialog then this button will be enabled and pressing it will open kompare's main view where the output of the entered file or files from the folder are mixed with the diff output so you can then apply the difference(s) to a file or to the files. " ) ); dialog->setButtonOK( blendGuiItem ); dialog->setGroup( "Recent Blend Files" ); @@ -377,7 +377,7 @@ void KompareShell::slotFileBlendURLAndDiff() dialog->setFirstURLRequesterMode( KFile::File|KFile::Directory|KFile::ExistingOnly ); // diff output can not be a directory dialog->setSecondURLRequesterMode( KFile::File|KFile::ExistingOnly ); - if ( dialog->exec() == QDialog::Accepted ) + if ( dialog->exec() == TQDialog::Accepted ) { m_sourceURL = dialog->getFirstURL(); m_destinationURL = dialog->getSecondURL(); @@ -398,7 +398,7 @@ void KompareShell::slotFileCompareFiles() dialog->setFirstGroupBoxTitle( i18n( "Source" ) ); dialog->setSecondGroupBoxTitle( i18n( "Destination" ) ); - KGuiItem compareGuiItem( i18n( "Compare" ), QString::null, i18n( "Compare these files or folders" ), i18n( "If you have entered 2 filenames or 2 folders in the fields in this dialog then this button will be enabled and pressing it will start a comparison of the entered files or folders. " ) ); + KGuiItem compareGuiItem( i18n( "Compare" ), TQString::null, i18n( "Compare these files or folders" ), i18n( "If you have entered 2 filenames or 2 folders in the fields in this dialog then this button will be enabled and pressing it will start a comparison of the entered files or folders. " ) ); dialog->setButtonOK( compareGuiItem ); dialog->setGroup( "Recent Compare Files" ); @@ -406,7 +406,7 @@ void KompareShell::slotFileCompareFiles() dialog->setFirstURLRequesterMode( KFile::File|KFile::Directory|KFile::ExistingOnly ); dialog->setSecondURLRequesterMode( KFile::File|KFile::Directory|KFile::ExistingOnly ); - if ( dialog->exec() == QDialog::Accepted ) + if ( dialog->exec() == TQDialog::Accepted ) { m_sourceURL = dialog->getFirstURL(); m_destinationURL = dialog->getSecondURL(); @@ -438,22 +438,22 @@ void KompareShell::slotShowTextView() // FIXME: proper error checking m_textViewWidget = createDockWidget( i18n("Text View"), SmallIcon( "text") ); m_textViewPart = KParts::ComponentFactory::createPartInstanceFromQuery<KTextEditor::Document>( - QString::fromLatin1("KTextEditor/Document"), - QString::null, (QWidget*)this, 0, (QWidget*)this, 0, QStringList(), &errCode ); + TQString::fromLatin1("KTextEditor/Document"), + TQString::null, (TQWidget*)this, 0, (TQWidget*)this, 0, TQStringList(), &errCode ); if ( m_textViewPart ) { m_textView = m_textViewPart->createView( this, 0 ); - m_textViewWidget->setWidget( static_cast<QWidget*>(m_textView) ); + m_textViewWidget->setWidget( static_cast<TQWidget*>(m_textView) ); m_textEditIface = editInterface( m_textViewPart ); - connect( m_viewPart, SIGNAL(diffString(const QString&)), - this, SLOT(slotSetDiffString(const QString&)) ); + connect( m_viewPart, TQT_SIGNAL(diffString(const TQString&)), + this, TQT_SLOT(slotSetDiffString(const TQString&)) ); } } m_textViewWidget->manualDock( m_mainViewDock, KDockWidget:: DockCenter ); } -void KompareShell::slotSetDiffString( const QString& diffString ) +void KompareShell::slotSetDiffString( const TQString& diffString ) { if ( m_textEditIface ) m_textEditIface->setText( diffString ); @@ -475,7 +475,7 @@ void KompareShell::optionsConfigureToolbars() saveMainWindowSettings( KGlobal::config(), autoSaveGroup() ); // use the standard toolbar editor KEditToolbar dlg(factory()); - connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(newToolbarConfig())); + connect(&dlg,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(newToolbarConfig())); dlg.exec(); } |