Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Filelight
Commits
473eff07
Commit
473eff07
authored
Dec 22, 2021
by
Laurent Montel
😁
Browse files
Fix compile error against qt6
parent
3fbe4e9d
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main.cpp
View file @
473eff07
...
...
@@ -21,21 +21,22 @@
int
main
(
int
argc
,
char
*
argv
[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
/**
* enable high dpi support
*/
QCoreApplication
::
setAttribute
(
Qt
::
AA_UseHighDpiPixmaps
,
true
);
QCoreApplication
::
setAttribute
(
Qt
::
AA_EnableHighDpiScaling
,
true
);
#endif
QApplication
app
(
argc
,
argv
);
KLocalizedString
::
setApplicationDomain
(
"filelight"
);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Kdelibs4ConfigMigrator
migrate
(
QStringLiteral
(
"filelight"
));
migrate
.
setConfigFiles
(
QStringList
()
<<
QStringLiteral
(
"filelightrc"
));
migrate
.
setUiFiles
(
QStringList
()
<<
QStringLiteral
(
"filelightui.rc"
));
migrate
.
migrate
();
#endif
auto
config
=
KSharedConfig
::
openConfig
();
auto
stateConfig
=
KSharedConfig
::
openStateConfig
();
if
(
config
->
hasGroup
(
"general"
))
{
...
...
src/radialMap/widget.h
View file @
473eff07
...
...
@@ -84,7 +84,11 @@ protected:
void
mousePressEvent
(
QMouseEvent
*
)
override
;
void
paintEvent
(
QPaintEvent
*
)
override
;
void
resizeEvent
(
QResizeEvent
*
)
override
;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void
enterEvent
(
QEnterEvent
*
event
)
override
;
#else
void
enterEvent
(
QEvent
*
)
override
;
#endif
void
leaveEvent
(
QEvent
*
)
override
;
protected:
...
...
src/radialMap/widgetEvents.cpp
View file @
473eff07
...
...
@@ -16,12 +16,11 @@
#include <KIO//DeleteJob>
#include <KMessageBox> //::mousePressEvent()
#include <QMenu> //::mousePressEvent()
#include <KT
oolInvocation
>
#include <KT
erminalLauncherJob
>
#include <QUrl>
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
#include <kio_version.h>
#include <QApplication> //QApplication::setOverrideCursor()
#include <QClipboard>
...
...
@@ -235,8 +234,11 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e)
Q_EMIT
mouseHover
(
m_focus
->
file
()
->
displayPath
());
update
();
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void
RadialMap
::
Widget
::
enterEvent
(
QEnterEvent
*
event
)
#else
void
RadialMap
::
Widget
::
enterEvent
(
QEvent
*
)
#endif
{
if
(
!
m_focus
)
return
;
...
...
@@ -337,7 +339,10 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
}
else
if
(
rescanAction
&&
clicked
==
rescanAction
)
{
Q_EMIT
rescanRequested
(
url
);
}
else
if
(
openTerminal
&&
clicked
==
openTerminal
)
{
KToolInvocation
::
invokeTerminal
(
QString
(),
QStringList
(),
url
.
path
());
KTerminalLauncherJob
*
job
=
new
KTerminalLauncherJob
(
QString
(),
this
);
job
->
setUiDelegate
(
new
KDialogJobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
setWorkingDirectory
(
url
.
path
());
job
->
start
();
}
else
if
(
centerMap
&&
clicked
==
centerMap
)
{
Q_EMIT
activated
(
url
);
//activate first, this will cause UI to prepare itself
createFromCache
((
Folder
*
)
m_focus
->
file
());
...
...
src/scan.cpp
View file @
473eff07
...
...
@@ -99,8 +99,11 @@ bool ScanManager::start(const QUrl &url)
//find a pointer to the requested branch
qCDebug
(
FILELIGHT_LOG
)
<<
"Cache-(a)hit: "
<<
cachePath
;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QVector
<
QStringRef
>
split
=
path
.
midRef
(
cachePath
.
length
()).
split
(
QLatin1Char
(
'/'
));
#else
QVector
<
QStringView
>
split
=
QStringView
(
path
).
mid
(
cachePath
.
length
()).
split
(
QLatin1Char
(
'/'
));
#endif
Folder
*
d
=
folder
;
while
(
!
split
.
isEmpty
()
&&
d
!=
nullptr
)
{
//if NULL we have got lost so abort!!
...
...
@@ -194,8 +197,11 @@ void ScanManager::invalidateCacheFor(const QUrl &url)
if
(
!
path
.
startsWith
(
cachePath
))
{
continue
;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QVector
<
QStringRef
>
splitPath
=
path
.
midRef
(
cachePath
.
length
()).
split
(
QLatin1Char
(
'/'
));
#else
QVector
<
QStringView
>
splitPath
=
QStringView
(
path
).
mid
(
cachePath
.
length
()).
split
(
QLatin1Char
(
'/'
));
#endif
Folder
*
d
=
folder
;
while
(
!
splitPath
.
isEmpty
()
&&
d
!=
nullptr
)
{
//if NULL we have got lost so abort!!
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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