Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Utilities
Filelight
Commits
b91c0f64
Commit
b91c0f64
authored
Sep 15, 2020
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Q_EMIT
parent
5f0506ed
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
32 deletions
+32
-32
src/historyAction.cpp
src/historyAction.cpp
+1
-1
src/localLister.cpp
src/localLister.cpp
+1
-1
src/mainWindow.cpp
src/mainWindow.cpp
+5
-5
src/radialMap/widget.cpp
src/radialMap/widget.cpp
+2
-2
src/radialMap/widgetEvents.cpp
src/radialMap/widgetEvents.cpp
+7
-7
src/remoteLister.cpp
src/remoteLister.cpp
+2
-2
src/scan.cpp
src/scan.cpp
+6
-6
src/settingsDialog.cpp
src/settingsDialog.cpp
+7
-7
src/summaryWidget.cpp
src/summaryWidget.cpp
+1
-1
No files found.
src/historyAction.cpp
View file @
b91c0f64
...
...
@@ -104,7 +104,7 @@ void HistoryCollection::pop() //slot
m_receiver
=
(
sender
()
==
m_b
)
?
m_f
:
m_b
;
emit
activated
(
url
);
Q_EMIT
activated
(
url
);
}
void
HistoryCollection
::
save
(
KConfigGroup
&
configgroup
)
...
...
src/localLister.cpp
View file @
b91c0f64
...
...
@@ -91,7 +91,7 @@ LocalLister::run()
tree
=
nullptr
;
}
qCDebug
(
FILELIGHT_LOG
)
<<
"Emitting signal to cache results ..."
;
emit
branchCompleted
(
tree
);
Q_EMIT
branchCompleted
(
tree
);
qCDebug
(
FILELIGHT_LOG
)
<<
"Thread terminating ..."
;
}
...
...
src/mainWindow.cpp
View file @
b91c0f64
...
...
@@ -467,8 +467,8 @@ bool MainWindow::start(const QUrl &url)
const
QString
s
=
i18n
(
"Scanning: %1"
,
prettyUrl
());
stateChanged
(
QStringLiteral
(
"scan_started"
));
emit
started
();
//as a MainWindow, we have to do this
emit
setWindowCaption
(
s
);
Q_EMIT
started
();
//as a MainWindow, we have to do this
Q_EMIT
setWindowCaption
(
s
);
statusBar
()
->
showMessage
(
s
);
m_map
->
hide
();
m_map
->
invalidate
();
//to maintain ui consistency
...
...
@@ -508,8 +508,8 @@ void MainWindow::folderScanCompleted(Folder *tree)
}
else
{
stateChanged
(
QStringLiteral
(
"scan_failed"
));
emit
canceled
(
i18n
(
"Scan failed: %1"
,
prettyUrl
()));
emit
setWindowCaption
(
QString
());
Q_EMIT
canceled
(
i18n
(
"Scan failed: %1"
,
prettyUrl
()));
Q_EMIT
setWindowCaption
(
QString
());
statusBar
()
->
clearMessage
();
...
...
@@ -526,7 +526,7 @@ void MainWindow::mapChanged(const Folder *tree)
{
//IMPORTANT -> url() has already been set
emit
setWindowCaption
(
prettyUrl
());
Q_EMIT
setWindowCaption
(
prettyUrl
());
const
int
fileCount
=
tree
->
children
();
const
QString
text
=
(
fileCount
==
0
)
?
...
...
src/radialMap/widget.cpp
View file @
b91c0f64
...
...
@@ -97,7 +97,7 @@ void RadialMap::Widget::invalidate()
update
();
//tell rest of Filelight
emit
invalidated
(
invalidatedUrl
);
Q_EMIT
invalidated
(
invalidatedUrl
);
}
}
...
...
@@ -124,7 +124,7 @@ RadialMap::Widget::create(const Folder *tree)
m_tree
=
tree
;
//tell rest of Filelight
emit
folderCreated
(
tree
);
Q_EMIT
folderCreated
(
tree
);
}
void
...
...
src/radialMap/widgetEvents.cpp
View file @
b91c0f64
...
...
@@ -146,7 +146,7 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e)
unsetCursor
();
update
();
emit
mouseHover
(
QString
());
Q_EMIT
mouseHover
(
QString
());
}
return
;
...
...
@@ -244,7 +244,7 @@ void RadialMap::Widget::mouseMoveEvent(QMouseEvent *e)
m_tooltip
.
show
();
emit
mouseHover
(
m_focus
->
file
()
->
displayPath
());
Q_EMIT
mouseHover
(
m_focus
->
file
()
->
displayPath
());
update
();
}
...
...
@@ -253,7 +253,7 @@ void RadialMap::Widget::enterEvent(QEvent *)
if
(
!
m_focus
)
return
;
setCursor
(
Qt
::
PointingHandCursor
);
emit
mouseHover
(
m_focus
->
file
()
->
displayPath
());
Q_EMIT
mouseHover
(
m_focus
->
file
()
->
displayPath
());
update
();
}
...
...
@@ -285,10 +285,10 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
if
(
e
->
button
()
==
Qt
::
LeftButton
)
{
if
(
m_focus
->
file
()
!=
m_tree
)
{
emit
activated
(
url
);
//activate first, this will cause UI to prepare itself
Q_EMIT
activated
(
url
);
//activate first, this will cause UI to prepare itself
createFromCache
((
Folder
*
)
m_focus
->
file
());
}
else
if
(
KIO
::
upUrl
(
url
)
!=
url
)
{
emit
giveMeTreeFor
(
KIO
::
upUrl
(
url
));
Q_EMIT
giveMeTreeFor
(
KIO
::
upUrl
(
url
));
}
return
;
...
...
@@ -344,7 +344,7 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
}
else
if
(
openTerminal
&&
clicked
==
openTerminal
)
{
KToolInvocation
::
invokeTerminal
(
QString
(),
url
.
path
());
}
else
if
(
centerMap
&&
clicked
==
centerMap
)
{
emit
activated
(
url
);
//activate first, this will cause UI to prepare itself
Q_EMIT
activated
(
url
);
//activate first, this will cause UI to prepare itself
createFromCache
((
Folder
*
)
m_focus
->
file
());
}
else
if
(
openFile
&&
clicked
==
openFile
)
{
new
KRun
(
url
,
this
,
true
);
...
...
@@ -392,7 +392,7 @@ void RadialMap::Widget::dropEvent(QDropEvent *e)
{
QList
<
QUrl
>
uriList
=
KUrlMimeData
::
urlsFromMimeData
(
e
->
mimeData
());
if
(
!
uriList
.
isEmpty
())
emit
giveMeTreeFor
(
uriList
.
first
());
Q_EMIT
giveMeTreeFor
(
uriList
.
first
());
}
void
RadialMap
::
Widget
::
dragEnterEvent
(
QDragEnterEvent
*
e
)
...
...
src/remoteLister.cpp
View file @
b91c0f64
...
...
@@ -101,7 +101,7 @@ RemoteLister::~RemoteLister()
void
RemoteLister
::
onCanceled
()
{
qCDebug
(
FILELIGHT_LOG
)
<<
"Canceled"
;
emit
branchCompleted
(
nullptr
);
Q_EMIT
branchCompleted
(
nullptr
);
deleteLater
();
}
...
...
@@ -153,7 +153,7 @@ void RemoteLister::onCompleted()
qCDebug
(
FILELIGHT_LOG
)
<<
"I think we're done"
;
Q_ASSERT
(
m_root
==
m_store
);
emit
branchCompleted
(
m_store
->
folder
);
Q_EMIT
branchCompleted
(
m_store
->
folder
);
deleteLater
();
}
...
...
src/scan.cpp
View file @
b91c0f64
...
...
@@ -141,14 +141,14 @@ bool ScanManager::start(const QUrl &url)
//we found a completed tree, thus no need to scan
qCDebug
(
FILELIGHT_LOG
)
<<
"Found cache-handle, generating map.."
;
emit
branchCacheHit
(
d
);
Q_EMIT
branchCacheHit
(
d
);
return
true
;
}
else
{
//something went wrong, we couldn't find the folder we were expecting
qCWarning
(
FILELIGHT_LOG
)
<<
"Didn't find "
<<
path
<<
" in the cache!
\n
"
;
it
.
remove
();
emit
aboutToEmptyCache
();
Q_EMIT
aboutToEmptyCache
();
delete
folder
;
break
;
//do a full scan
}
...
...
@@ -193,7 +193,7 @@ void ScanManager::invalidateCacheFor(const QUrl &url)
QString
path
=
url
.
toLocalFile
();
if
(
!
path
.
endsWith
(
QDir
::
separator
()))
path
+=
QDir
::
separator
();
emit
aboutToEmptyCache
();
Q_EMIT
aboutToEmptyCache
();
QMutableListIterator
<
Folder
*>
it
(
m_cache
);
while
(
it
.
hasNext
())
{
...
...
@@ -241,7 +241,7 @@ void ScanManager::emptyCache()
m_thread
->
wait
();
}
emit
aboutToEmptyCache
();
Q_EMIT
aboutToEmptyCache
();
qDeleteAll
(
m_cache
);
m_cache
.
clear
();
...
...
@@ -259,7 +259,7 @@ void ScanManager::cacheTree(Folder *tree)
m_thread
=
nullptr
;
}
emit
completed
(
tree
);
Q_EMIT
completed
(
tree
);
if
(
tree
)
{
//we don't cache foreign stuff
...
...
@@ -276,7 +276,7 @@ void ScanManager::cacheTree(Folder *tree)
void
ScanManager
::
foundCached
(
Folder
*
tree
)
{
emit
completed
(
tree
);
Q_EMIT
completed
(
tree
);
QGuiApplication
::
restoreOverrideCursor
();
}
...
...
src/settingsDialog.cpp
View file @
b91c0f64
...
...
@@ -206,41 +206,41 @@ void SettingsDialog::changeScheme(QAbstractButton *button)
if
(
button
)
{
const
int
s
=
m_schemaGroup
->
id
(
button
);
Config
::
scheme
=
(
Filelight
::
MapScheme
)
s
;
emit
canvasIsDirty
(
1
);
Q_EMIT
canvasIsDirty
(
1
);
}
}
void
SettingsDialog
::
changeContrast
(
int
c
)
{
Config
::
contrast
=
c
;
emit
canvasIsDirty
(
3
);
Q_EMIT
canvasIsDirty
(
3
);
}
void
SettingsDialog
::
toggleUseAntialiasing
(
bool
b
)
{
Config
::
antialias
=
b
;
emit
canvasIsDirty
(
2
);
Q_EMIT
canvasIsDirty
(
2
);
}
void
SettingsDialog
::
toggleVaryLabelFontSizes
(
bool
b
)
{
Config
::
varyLabelFontSizes
=
b
;
minFontPitchLabel
->
setEnabled
(
b
);
minFontPitch
->
setEnabled
(
b
);
emit
canvasIsDirty
(
0
);
Q_EMIT
canvasIsDirty
(
0
);
}
void
SettingsDialog
::
changeMinFontPitch
(
int
p
)
{
Config
::
minFontPitch
=
p
;
emit
canvasIsDirty
(
0
);
Q_EMIT
canvasIsDirty
(
0
);
}
void
SettingsDialog
::
toggleShowSmallFiles
(
bool
b
)
{
Config
::
showSmallFiles
=
b
;
emit
canvasIsDirty
(
1
);
Q_EMIT
canvasIsDirty
(
1
);
}
void
SettingsDialog
::
slotSliderReleased
()
{
emit
canvasIsDirty
(
2
);
Q_EMIT
canvasIsDirty
(
2
);
}
...
...
src/summaryWidget.cpp
View file @
b91c0f64
...
...
@@ -84,7 +84,7 @@ public:
RadialMap
::
Widget
::
mousePressEvent
(
e
);
}
else
if
(
e
->
button
()
==
Qt
::
LeftButton
)
{
// and clicks to the used segment
emit
activated
(
url
());
Q_EMIT
activated
(
url
());
}
}
};
...
...
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