Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
KDiff3
Commits
c81717f0
Commit
c81717f0
authored
Jul 24, 2016
by
Michael Reeves
Browse files
*auto port away from KAction and KUrl.
parent
10f46203
Changes
11
Hide whitespace changes
Inline
Side-by-side
kdiff3plugin/kdiff3plugin.cpp
View file @
c81717f0
...
...
@@ -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>
...
...
src/difftextwindow.cpp
View file @
c81717f0
...
...
@@ -1815,7 +1815,7 @@ void DiffTextWindowFrame::slotBrowseButtonClicked()
{
QString
current
=
d
->
m_pFileSelection
->
text
();
K
Url
newURL
=
QFileDialog
::
getOpenFileUrl
(
this
,
QString
(),
current
,
0
);
Q
Url
newURL
=
QFileDialog
::
getOpenFileUrl
(
this
,
QString
(),
current
,
0
);
if
(
!
newURL
.
isEmpty
()
)
{
DiffTextWindow
*
pDTW
=
d
->
m_pDiffTextWindow
;
...
...
src/directorymergewindow.h
View file @
c81717f0
...
...
@@ -32,7 +32,7 @@ class StatusInfo;
class
DirectoryMergeInfo
;
class
OneDirectoryInfo
;
class
QLabel
;
class
K
Action
;
class
Q
Action
;
class
KToggleAction
;
class
KActionCollection
;
class
TotalDiffStatus
;
...
...
src/fileaccess.cpp
View file @
c81717f0
...
...
@@ -52,7 +52,7 @@ public:
}
void
reset
()
{
m_url
=
K
Url
();
m_url
=
Q
Url
();
m_bValidData
=
false
;
m_name
=
QString
();
//m_creationTime = QDateTime();
...
...
@@ -65,7 +65,7 @@ public:
m_pParent
=
0
;
}
K
Url
m_url
;
Q
Url
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
=
K
Url
(
fi
.
filePath
()
);
d
()
->
m_url
=
Q
Url
(
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
()
)
{
K
Url
url
(
name
);
Q
Url
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 =
K
Url( e.stringValue(f) );
case
KIO
::
UDSEntry
::
UDS_URL
:
// m_url =
Q
Url( 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
();
}
K
Url
FileAccess
::
url
()
const
Q
Url
FileAccess
::
url
()
const
{
if
(
d
()
!=
0
)
return
d
()
->
m_url
;
else
{
K
Url
url
(
m_filePath
);
Q
Url
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
{
K
Url
url
(
path
);
Q
Url
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
)
{
K
Url
dirURL
=
K
Url
(
dirName
);
Q
Url
dirURL
=
Q
Url
(
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
)
{
K
Url
dirURL
=
K
Url
(
dirName
);
Q
Url
dirURL
=
Q
Url
(
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
;
K
Url
kurl
(
dest
);
Q
Url
kurl
(
dest
);
if
(
kurl
.
isRelative
()
)
kurl
=
K
Url
(
QDir
().
absoluteFilePath
(
dest
)
);
// assuming that invalid means relative
kurl
=
Q
Url
(
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
;
K
Url
destUrl
(
dest
);
Q
Url
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
)
{
K
Url
parentUrl
(
m_pFileAccess
->
absoluteFilePath
()
);
Q
Url
parentUrl
(
m_pFileAccess
->
absoluteFilePath
()
);
KIO
::
UDSEntryList
::
ConstIterator
i
;
for
(
i
=
l
.
begin
();
i
!=
l
.
end
();
++
i
)
...
...
src/fileaccess.h
View file @
c81717f0
...
...
@@ -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
;
K
Url
url
()
const
;
Q
Url
url
()
const
;
QString
absoluteFilePath
()
const
;
bool
isLocal
()
const
;
...
...
src/guiutils.h
View file @
c81717f0
...
...
@@ -29,14 +29,14 @@ namespace KDiff3 {
const
char
*
actionName
);
template
<
>
inline
K
Action
*
createAction
<
K
Action
>
(
inline
Q
Action
*
createAction
<
Q
Action
>
(
const
QString
&
text
,
const
QObject
*
receiver
,
const
char
*
slot
,
KActionCollection
*
ac
,
const
char
*
actionName
)
{
assert
(
ac
!=
0
);
K
Action
*
theAction
=
ac
->
addAction
(
actionName
);
Q
Action
*
theAction
=
ac
->
addAction
(
actionName
);
theAction
->
setText
(
text
);
QObject
::
connect
(
theAction
,
SIGNAL
(
triggered
()
),
receiver
,
slot
);
return
theAction
;
...
...
src/kdiff3.h
View file @
c81717f0
...
...
@@ -29,8 +29,8 @@
// include files for KDE
#include
<QApplication>
#include
<kmainwindow.h>
#include
<
ka
ction
.h
>
#include
<
kurl.h
>
#include
<
QA
ction>
#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;
//
K
Action pointers to enable/disable actions
K
Action
*
fileOpen
;
K
Action
*
fileSave
;
K
Action
*
fileSaveAs
;
K
Action
*
filePrint
;
K
Action
*
fileQuit
;
K
Action
*
fileReload
;
K
Action
*
editCut
;
K
Action
*
editCopy
;
K
Action
*
editPaste
;
K
Action
*
editSelectAll
;
//
Q
Action pointers to enable/disable actions
Q
Action
*
fileOpen
;
Q
Action
*
fileSave
;
Q
Action
*
fileSaveAs
;
Q
Action
*
filePrint
;
Q
Action
*
fileQuit
;
Q
Action
*
fileReload
;
Q
Action
*
editCut
;
Q
Action
*
editCopy
;
Q
Action
*
editPaste
;
Q
Action
*
editSelectAll
;
KToggleAction
*
viewToolBar
;
KToggleAction
*
viewStatusBar
;
////////////////////////////////////////////////////////////////////////
// Special KDiff3 specific stuff starts here
K
Action
*
editFind
;
K
Action
*
editFindNext
;
K
Action
*
goCurrent
;
K
Action
*
goTop
;
K
Action
*
goBottom
;
K
Action
*
goPrevUnsolvedConflict
;
K
Action
*
goNextUnsolvedConflict
;
K
Action
*
goPrevConflict
;
K
Action
*
goNextConflict
;
K
Action
*
goPrevDelta
;
K
Action
*
goNextDelta
;
Q
Action
*
editFind
;
Q
Action
*
editFindNext
;
Q
Action
*
goCurrent
;
Q
Action
*
goTop
;
Q
Action
*
goBottom
;
Q
Action
*
goPrevUnsolvedConflict
;
Q
Action
*
goNextUnsolvedConflict
;
Q
Action
*
goPrevConflict
;
Q
Action
*
goNextConflict
;
Q
Action
*
goPrevDelta
;
Q
Action
*
goNextDelta
;
KToggleAction
*
chooseA
;
KToggleAction
*
chooseB
;
KToggleAction
*
chooseC
;
KToggleAction
*
autoAdvance
;
KToggleAction
*
wordWrap
;
K
Action
*
splitDiff
;
K
Action
*
joinDiffs
;
K
Action
*
addManualDiffHelp
;
K
Action
*
clearManualDiffHelpList
;
Q
Action
*
splitDiff
;
Q
Action
*
joinDiffs
;
Q
Action
*
addManualDiffHelp
;
Q
Action
*
clearManualDiffHelpList
;
KToggleAction
*
showWhiteSpaceCharacters
;
KToggleAction
*
showWhiteSpace
;
KToggleAction
*
showLineNumbers
;
K
Action
*
chooseAEverywhere
;
K
Action
*
chooseBEverywhere
;
K
Action
*
chooseCEverywhere
;
K
Action
*
chooseAForUnsolvedConflicts
;
K
Action
*
chooseBForUnsolvedConflicts
;
K
Action
*
chooseCForUnsolvedConflicts
;
K
Action
*
chooseAForUnsolvedWhiteSpaceConflicts
;
K
Action
*
chooseBForUnsolvedWhiteSpaceConflicts
;
K
Action
*
chooseCForUnsolvedWhiteSpaceConflicts
;
K
Action
*
autoSolve
;
K
Action
*
unsolve
;
K
Action
*
mergeHistory
;
K
Action
*
mergeRegExp
;
Q
Action
*
chooseAEverywhere
;
Q
Action
*
chooseBEverywhere
;
Q
Action
*
chooseCEverywhere
;
Q
Action
*
chooseAForUnsolvedConflicts
;
Q
Action
*
chooseBForUnsolvedConflicts
;
Q
Action
*
chooseCForUnsolvedConflicts
;
Q
Action
*
chooseAForUnsolvedWhiteSpaceConflicts
;
Q
Action
*
chooseBForUnsolvedWhiteSpaceConflicts
;
Q
Action
*
chooseCForUnsolvedWhiteSpaceConflicts
;
Q
Action
*
autoSolve
;
Q
Action
*
unsolve
;
Q
Action
*
mergeHistory
;
Q
Action
*
mergeRegExp
;
KToggleAction
*
showWindowA
;
KToggleAction
*
showWindowB
;
KToggleAction
*
showWindowC
;
K
Action
*
winFocusNext
;
K
Action
*
winFocusPrev
;
K
Action
*
winToggleSplitOrientation
;
Q
Action
*
winFocusNext
;
Q
Action
*
winFocusPrev
;
Q
Action
*
winToggleSplitOrientation
;
KToggleAction
*
dirShowBoth
;
K
Action
*
dirViewToggle
;
Q
Action
*
dirViewToggle
;
KToggleAction
*
overviewModeNormal
;
KToggleAction
*
overviewModeAB
;
KToggleAction
*
overviewModeAC
;
...
...
src/kdiff3_shell.cpp
View file @
c81717f0
...
...
@@ -24,7 +24,7 @@
#include
<kshortcutsdialog.h>
#include
<kfiledialog.h>
#include
<kconfig.h>
#include
<
kurl.h
>
#include
<
QUrl
>
#include
<kedittoolbar.h>
...
...
src/mergeresultwindow.cpp
View file @
c81717f0
...
...
@@ -3418,7 +3418,7 @@ void WindowTitleWidget::setEncoding(QTextCodec* pEncoding)
//{
// QString current = m_pFileNameLineEdit->text();
//
//
K
Url newURL = KFileDialog::getSaveUrl( current, 0, this, i18n("Select file (not saving yet)"));
//
Q
Url newURL = KFileDialog::getSaveUrl( current, 0, this, i18n("Select file (not saving yet)"));
// if ( !newURL.isEmpty() )
// {
// m_pFileNameLineEdit->setText( newURL.url() );
...
...
src/pdiff.cpp
View file @
c81717f0
...
...
@@ -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
();
...
...
src/smalldialogs.cpp
View file @
c81717f0
...
...
@@ -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
(
K
Url
(
n1
).
prettyUrl
()
);
m_pLineA
->
setEditText
(
Q
Url
(
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
(
K
Url
(
n2
).
prettyUrl
()
);
m_pLineB
->
setEditText
(
Q
Url
(
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
(
K
Url
(
n3
).
prettyUrl
()
);
m_pLineC
->
setEditText
(
Q
Url
(
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
(
K
Url
(
outputName
).
prettyUrl
()
);
m_pLineOut
->
setEditText
(
Q
Url
(
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
();
}
/*
K
Url newURL = bDir ? KFileDialog::getExistingDirectoryUrl( current, this)
/*
Q
Url newURL = bDir ? KFileDialog::getExistingDirectoryUrl( current, this)
: bSave ? KFileDialog::getSaveUrl( current, "all/allfiles", this)
: KFileDialog::getOpenUrl( current, "all/allfiles", this);*/
K
Url
newURL
;
Q
Url
newURL
;
if
(
!
bDir
){
newURL
=
bSave
?
KFileDialog
::
getSaveUrl
(
current
,
"all/allfiles"
,
this
)
:
KFileDialog
::
getOpenUrl
(
current
,
"all/allfiles"
,
this
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment