Commit c81717f0 authored by Michael Reeves's avatar Michael Reeves
Browse files

*auto port away from KAction and KUrl.

parent 10f46203
......@@ -26,7 +26,7 @@
#include <kactionmenu.h>
#include <KLocalizedString>
#include <kgenericfactory.h>
#include <kurl.h>
#include <QUrl>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <konq_popupmenuinformation.h>
......
......@@ -1815,7 +1815,7 @@ void DiffTextWindowFrame::slotBrowseButtonClicked()
{
QString current = d->m_pFileSelection->text();
KUrl newURL = QFileDialog::getOpenFileUrl(this, QString(), current, 0);
QUrl newURL = QFileDialog::getOpenFileUrl(this, QString(), current, 0);
if ( !newURL.isEmpty() )
{
DiffTextWindow* pDTW = d->m_pDiffTextWindow;
......
......@@ -32,7 +32,7 @@ class StatusInfo;
class DirectoryMergeInfo;
class OneDirectoryInfo;
class QLabel;
class KAction;
class QAction;
class KToggleAction;
class KActionCollection;
class TotalDiffStatus;
......
......@@ -52,7 +52,7 @@ public:
}
void reset()
{
m_url = KUrl();
m_url = QUrl();
m_bValidData = false;
m_name = QString();
//m_creationTime = QDateTime();
......@@ -65,7 +65,7 @@ public:
m_pParent = 0;
}
KUrl m_url;
QUrl m_url;
bool m_bLocal;
bool m_bValidData;
......@@ -250,7 +250,7 @@ void FileAccess::setFile( const QFileInfo& fi, FileAccess* pParent )
}
d()->m_bLocal = true;
d()->m_bValidData = true;
d()->m_url = KUrl( fi.filePath() );
d()->m_url = QUrl( fi.filePath() );
if ( d()->m_url.isRelative() )
{
d()->m_url.setPath( absoluteFilePath() );
......@@ -306,7 +306,7 @@ void FileAccess::setFile( const QString& name, bool bWantToWrite )
// (This is a Win95-bug which has been corrected only in WinNT/2000/XP.)
if ( !name.isEmpty() )
{
KUrl url( name );
QUrl url( name );
// FileAccess tries to detect if the given name is an URL or a local file.
// This is a problem if the filename looks like an URL (i.e. contains a colon ':').
......@@ -443,7 +443,7 @@ void FileAccess::setUdsEntry( const KIO::UDSEntry& e )
break;
}
case KIO::UDSEntry::UDS_URL : // m_url = KUrl( e.stringValue(f) );
case KIO::UDSEntry::UDS_URL : // m_url = QUrl( e.stringValue(f) );
break;
case KIO::UDSEntry::UDS_MIME_TYPE : break;
case KIO::UDSEntry::UDS_GUESSED_MIME_TYPE : break;
......@@ -509,13 +509,13 @@ qint64 FileAccess::size() const
return QFileInfo( absoluteFilePath() ).size();
}
KUrl FileAccess::url() const
QUrl FileAccess::url() const
{
if ( d()!=0 )
return d()->m_url;
else
{
KUrl url( m_filePath );
QUrl url( m_filePath );
if ( url.isRelative() )
{
url.setPath( absoluteFilePath() );
......@@ -650,7 +650,7 @@ const FileAccess::Data* FileAccess::d() const
QString FileAccess::prettyAbsPath() const
{
return isLocal() ? absoluteFilePath() : d()->m_url.prettyUrl();
return isLocal() ? absoluteFilePath() : d()->m_url.toDisplayString();
}
/*
......@@ -938,7 +938,7 @@ void FileAccess::setStatusText( const QString& s )
QString FileAccess::cleanPath( const QString& path ) // static
{
KUrl url(path);
QUrl url(path);
if ( url.isLocalFile() || ! url.isValid() )
{
return QDir().cleanPath( path );
......@@ -1125,7 +1125,7 @@ void FileAccessJobHandler::slotPutJobResult(KJob* pJob)
bool FileAccessJobHandler::mkDir( const QString& dirName )
{
KUrl dirURL = KUrl( dirName );
QUrl dirURL = QUrl( dirName );
if ( dirName.isEmpty() )
return false;
else if ( dirURL.isLocalFile() || dirURL.isRelative() )
......@@ -1145,7 +1145,7 @@ bool FileAccessJobHandler::mkDir( const QString& dirName )
bool FileAccessJobHandler::rmDir( const QString& dirName )
{
KUrl dirURL = KUrl( dirName );
QUrl dirURL = QUrl( dirName );
if ( dirName.isEmpty() )
return false;
else if ( dirURL.isLocalFile() )
......@@ -1199,9 +1199,9 @@ bool FileAccessJobHandler::rename( const QString& dest )
if ( dest.isEmpty() )
return false;
KUrl kurl( dest );
QUrl kurl( dest );
if ( kurl.isRelative() )
kurl = KUrl( QDir().absoluteFilePath(dest) ); // assuming that invalid means relative
kurl = QUrl( QDir().absoluteFilePath(dest) ); // assuming that invalid means relative
if ( m_pFileAccess->isLocal() && kurl.isLocalFile() )
{
......@@ -1240,7 +1240,7 @@ void FileAccessJobHandler::slotSimpleJobResult(KJob* pJob)
bool FileAccessJobHandler::copyFile( const QString& dest )
{
ProgressProxyExtender pp;
KUrl destUrl( dest );
QUrl destUrl( dest );
m_pFileAccess->setStatusText( QString() );
if ( ! m_pFileAccess->isLocal() || ! destUrl.isLocalFile() ) // if either url is nonlocal
{
......@@ -1780,7 +1780,7 @@ bool FileAccessJobHandler::listDir( t_DirectoryList* pDirList, bool bRecursive,
void FileAccessJobHandler::slotListDirProcessNewEntries( KIO::Job*, const KIO::UDSEntryList& l )
{
KUrl parentUrl( m_pFileAccess->absoluteFilePath() );
QUrl parentUrl( m_pFileAccess->absoluteFilePath() );
KIO::UDSEntryList::ConstIterator i;
for ( i=l.begin(); i!=l.end(); ++i )
......
......@@ -18,7 +18,7 @@
#include <kprogressdialog.h>
#include <kio/job.h>
#include <kio/jobclasses.h>
#include <kurl.h>
#include <QUrl>
#include <list>
......@@ -66,7 +66,7 @@ public:
QString fileName() const; // Just the name-part of the path, without parent directories
QString filePath() const; // The path-string that was used during construction
QString prettyAbsPath() const;
KUrl url() const;
QUrl url() const;
QString absoluteFilePath() const;
bool isLocal() const;
......
......@@ -29,14 +29,14 @@ namespace KDiff3 {
const char* actionName);
template <>
inline KAction* createAction<KAction>(
inline QAction * createAction<QAction>(
const QString& text,
const QObject* receiver,
const char* slot,
KActionCollection* ac,
const char* actionName) {
assert( ac != 0 );
KAction* theAction = ac->addAction( actionName );
QAction * theAction = ac->addAction( actionName );
theAction->setText( text );
QObject::connect( theAction, SIGNAL( triggered() ), receiver, slot );
return theAction;
......
......@@ -29,8 +29,8 @@
// include files for KDE
#include <QApplication>
#include <kmainwindow.h>
#include <kaction.h>
#include <kurl.h>
#include <QAction>
#include <QUrl>
#include <kparts/mainwindow.h>
#include <ktoggleaction.h>
#include <K4AboutData>
......@@ -181,67 +181,67 @@ class KDiff3App : public QSplitter
/** the configuration object of the application */
//KConfig *config;
// KAction pointers to enable/disable actions
KAction* fileOpen;
KAction* fileSave;
KAction* fileSaveAs;
KAction* filePrint;
KAction* fileQuit;
KAction* fileReload;
KAction* editCut;
KAction* editCopy;
KAction* editPaste;
KAction* editSelectAll;
// QAction pointers to enable/disable actions
QAction * fileOpen;
QAction * fileSave;
QAction * fileSaveAs;
QAction * filePrint;
QAction * fileQuit;
QAction * fileReload;
QAction * editCut;
QAction * editCopy;
QAction * editPaste;
QAction * editSelectAll;
KToggleAction* viewToolBar;
KToggleAction* viewStatusBar;
////////////////////////////////////////////////////////////////////////
// Special KDiff3 specific stuff starts here
KAction *editFind;
KAction *editFindNext;
KAction *goCurrent;
KAction *goTop;
KAction *goBottom;
KAction *goPrevUnsolvedConflict;
KAction *goNextUnsolvedConflict;
KAction *goPrevConflict;
KAction *goNextConflict;
KAction *goPrevDelta;
KAction *goNextDelta;
QAction *editFind;
QAction *editFindNext;
QAction *goCurrent;
QAction *goTop;
QAction *goBottom;
QAction *goPrevUnsolvedConflict;
QAction *goNextUnsolvedConflict;
QAction *goPrevConflict;
QAction *goNextConflict;
QAction *goPrevDelta;
QAction *goNextDelta;
KToggleAction *chooseA;
KToggleAction *chooseB;
KToggleAction *chooseC;
KToggleAction *autoAdvance;
KToggleAction *wordWrap;
KAction* splitDiff;
KAction* joinDiffs;
KAction* addManualDiffHelp;
KAction* clearManualDiffHelpList;
QAction * splitDiff;
QAction * joinDiffs;
QAction * addManualDiffHelp;
QAction * clearManualDiffHelpList;
KToggleAction *showWhiteSpaceCharacters;
KToggleAction *showWhiteSpace;
KToggleAction *showLineNumbers;
KAction* chooseAEverywhere;
KAction* chooseBEverywhere;
KAction* chooseCEverywhere;
KAction* chooseAForUnsolvedConflicts;
KAction* chooseBForUnsolvedConflicts;
KAction* chooseCForUnsolvedConflicts;
KAction* chooseAForUnsolvedWhiteSpaceConflicts;
KAction* chooseBForUnsolvedWhiteSpaceConflicts;
KAction* chooseCForUnsolvedWhiteSpaceConflicts;
KAction* autoSolve;
KAction* unsolve;
KAction* mergeHistory;
KAction* mergeRegExp;
QAction * chooseAEverywhere;
QAction * chooseBEverywhere;
QAction * chooseCEverywhere;
QAction * chooseAForUnsolvedConflicts;
QAction * chooseBForUnsolvedConflicts;
QAction * chooseCForUnsolvedConflicts;
QAction * chooseAForUnsolvedWhiteSpaceConflicts;
QAction * chooseBForUnsolvedWhiteSpaceConflicts;
QAction * chooseCForUnsolvedWhiteSpaceConflicts;
QAction * autoSolve;
QAction * unsolve;
QAction * mergeHistory;
QAction * mergeRegExp;
KToggleAction *showWindowA;
KToggleAction *showWindowB;
KToggleAction *showWindowC;
KAction *winFocusNext;
KAction *winFocusPrev;
KAction* winToggleSplitOrientation;
QAction *winFocusNext;
QAction *winFocusPrev;
QAction * winToggleSplitOrientation;
KToggleAction *dirShowBoth;
KAction *dirViewToggle;
QAction *dirViewToggle;
KToggleAction *overviewModeNormal;
KToggleAction *overviewModeAB;
KToggleAction *overviewModeAC;
......
......@@ -24,7 +24,7 @@
#include <kshortcutsdialog.h>
#include <kfiledialog.h>
#include <kconfig.h>
#include <kurl.h>
#include <QUrl>
#include <kedittoolbar.h>
......
......@@ -3418,7 +3418,7 @@ void WindowTitleWidget::setEncoding(QTextCodec* pEncoding)
//{
// QString current = m_pFileNameLineEdit->text();
//
// KUrl newURL = KFileDialog::getSaveUrl( current, 0, this, i18n("Select file (not saving yet)"));
// QUrl newURL = KFileDialog::getSaveUrl( current, 0, this, i18n("Select file (not saving yet)"));
// if ( !newURL.isEmpty() )
// {
// m_pFileNameLineEdit->setText( newURL.url() );
......
......@@ -957,7 +957,7 @@ bool KDiff3App::eventFilter( QObject* o, QEvent* e )
init();
}
#else
KUrl::List urlList = KUrl::List::fromMimeData( pDropEvent->mimeData() );
QList<QUrl> urlList = QList<QUrl>::fromMimeData( pDropEvent->mimeData() );
if ( canContinue() && !urlList.isEmpty() )
{
raise();
......
......@@ -61,7 +61,7 @@ OpenDialog::OpenDialog(
m_pLineA = new QComboBox();
m_pLineA->setEditable(true);
m_pLineA->insertItems( 0, m_pOptions->m_recentAFiles );
m_pLineA->setEditText( KUrl(n1).prettyUrl() );
m_pLineA->setEditText( QUrl(n1).prettyUrl() );
m_pLineA->setMinimumWidth( 200 );
QPushButton * button = new QPushButton( i18n("File..."), this );
connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileA);
......@@ -78,7 +78,7 @@ OpenDialog::OpenDialog(
m_pLineB = new QComboBox();
m_pLineB->setEditable(true);
m_pLineB->insertItems( 0, m_pOptions->m_recentBFiles );
m_pLineB->setEditText( KUrl(n2).prettyUrl() );
m_pLineB->setEditText( QUrl(n2).prettyUrl() );
m_pLineB->setMinimumWidth( 200 );
button = new QPushButton( i18n("File..."), this );
connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileB);
......@@ -95,7 +95,7 @@ OpenDialog::OpenDialog(
m_pLineC= new QComboBox();
m_pLineC->setEditable(true);
m_pLineC->insertItems( 0, m_pOptions->m_recentCFiles );
m_pLineC->setEditText( KUrl(n3).prettyUrl() );
m_pLineC->setEditText( QUrl(n3).prettyUrl() );
m_pLineC->setMinimumWidth( 200 );
button = new QPushButton( i18n("File..."), this );
connect(button, &QPushButton::clicked, this, &OpenDialog::selectFileC);
......@@ -138,7 +138,7 @@ OpenDialog::OpenDialog(
m_pLineOut = new QComboBox();
m_pLineOut->setEditable(true);
m_pLineOut->insertItems( 0, m_pOptions->m_recentOutputFiles );
m_pLineOut->setEditText( KUrl(outputName).prettyUrl() );
m_pLineOut->setEditText( QUrl(outputName).prettyUrl() );
m_pLineOut->setMinimumWidth( 200 );
button = new QPushButton( i18n("File..."), this );
connect(button, &QPushButton::clicked, this, &OpenDialog::selectOutputName);
......@@ -232,11 +232,11 @@ void OpenDialog::selectURL( QComboBox* pLine, bool bDir, int i, bool bSave )
if (current.isEmpty() ){ current = m_pLineB->currentText(); }
if (current.isEmpty() ){ current = m_pLineA->currentText(); }
/*KUrl newURL = bDir ? KFileDialog::getExistingDirectoryUrl( current, this)
/*QUrl newURL = bDir ? KFileDialog::getExistingDirectoryUrl( current, this)
: bSave ? KFileDialog::getSaveUrl( current, "all/allfiles", this)
: KFileDialog::getOpenUrl( current, "all/allfiles", this);*/
KUrl newURL;
QUrl newURL;
if(!bDir){
newURL = bSave ? KFileDialog::getSaveUrl( current, "all/allfiles", this)
: KFileDialog::getOpenUrl( current, "all/allfiles", this);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment