Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Graphics
Gwenview
Commits
8d62b127
Commit
8d62b127
authored
Jul 13, 2020
by
Alexander Volkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use QMetaObject::invokeMethod() overloads for function pointers
... to check slots spelling at compile time.
parent
12206443
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
17 additions
and
17 deletions
+17
-17
app/browsemainpage.cpp
app/browsemainpage.cpp
+1
-1
app/fileopscontextmanageritem.cpp
app/fileopscontextmanageritem.cpp
+1
-1
app/folderviewcontextmanageritem.cpp
app/folderviewcontextmanageritem.cpp
+1
-1
app/kipiinterface.cpp
app/kipiinterface.cpp
+1
-1
importer/main.cpp
importer/main.cpp
+1
-1
lib/contextmanager.cpp
lib/contextmanager.cpp
+1
-1
lib/document/documentjob.cpp
lib/document/documentjob.cpp
+1
-1
lib/documentview/documentview.cpp
lib/documentview/documentview.cpp
+2
-2
lib/documentview/documentviewcontainer.cpp
lib/documentview/documentviewcontainer.cpp
+1
-1
lib/documentview/rasterimageview.cpp
lib/documentview/rasterimageview.cpp
+1
-1
lib/documentview/svgviewadapter.cpp
lib/documentview/svgviewadapter.cpp
+1
-1
lib/documentview/videoviewadapter.cpp
lib/documentview/videoviewadapter.cpp
+1
-1
lib/mpris2/dbusabstractadaptor.cpp
lib/mpris2/dbusabstractadaptor.cpp
+1
-1
lib/thumbnailprovider/thumbnailprovider.cpp
lib/thumbnailprovider/thumbnailprovider.cpp
+1
-1
tests/auto/documenttest.cpp
tests/auto/documenttest.cpp
+2
-2
No files found.
app/browsemainpage.cpp
View file @
8d62b127
...
...
@@ -561,7 +561,7 @@ void BrowseMainPage::slotUrlsDropped(const QUrl &destUrl, QDropEvent* event)
// We can't call FileOperations::showMenuForDroppedUrls() directly because
// we need the slot to return so that the drop event is accepted. Otherwise
// the drop cursor is still visible when the menu is shown.
QMetaObject
::
invokeMethod
(
this
,
"
showMenuForDroppedUrls
"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QList
<
QUrl
>
,
urlList
),
Q_ARG
(
QUrl
,
destUrl
)
);
QMetaObject
::
invokeMethod
(
this
,
[
this
,
urlList
,
destUrl
]()
{
showMenuForDroppedUrls
(
urlList
,
destUrl
);
}
,
Qt
::
QueuedConnection
);
}
void
BrowseMainPage
::
showMenuForDroppedUrls
(
const
QList
<
QUrl
>&
urlList
,
const
QUrl
&
destUrl
)
...
...
app/fileopscontextmanageritem.cpp
View file @
8d62b127
...
...
@@ -224,7 +224,7 @@ FileOpsContextManagerItem::FileOpsContextManagerItem(ContextManager* manager, QL
// Delay action update because it must happen *after* main window has called
// createGUI(), otherwise calling mXMLGUIClient->plugActionList() will
// fail.
QMetaObject
::
invokeMethod
(
this
,
"
updateActions
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
FileOpsContextManagerItem
::
updateActions
,
Qt
::
QueuedConnection
);
}
FileOpsContextManagerItem
::~
FileOpsContextManagerItem
()
...
...
app/folderviewcontextmanageritem.cpp
View file @
8d62b127
...
...
@@ -177,7 +177,7 @@ void FolderViewContextManagerItem::slotRowsInserted(const QModelIndex& parentInd
if
(
!
parentIndex
.
isValid
()
||
mModel
->
urlForIndex
(
parentIndex
).
isParentOf
(
mUrlToSelect
))
{
mExpandingIndex
=
parentIndex
;
// Hack because otherwise indexes are not in correct order!
QMetaObject
::
invokeMethod
(
this
,
"
expandToSelectedUrl
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
FolderViewContextManagerItem
::
expandToSelectedUrl
,
Qt
::
QueuedConnection
);
}
}
...
...
app/kipiinterface.cpp
View file @
8d62b127
...
...
@@ -320,7 +320,7 @@ void KIPIInterface::loadOnePlugin()
// If we reach this point, we just loaded one plugin. Go back to the
// event loop. We will come back to load the remaining plugins or create
// the menu later
QMetaObject
::
invokeMethod
(
this
,
"
loadOnePlugin
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
KIPIInterface
::
loadOnePlugin
,
Qt
::
QueuedConnection
);
return
;
}
...
...
importer/main.cpp
View file @
8d62b127
...
...
@@ -74,6 +74,6 @@ int main(int argc, char *argv[])
Gwenview
::
ImportDialog
*
dialog
=
new
Gwenview
::
ImportDialog
();
dialog
->
show
();
QMetaObject
::
invokeMethod
(
dialog
,
"setSourceUrl"
,
Qt
::
QueuedConnection
,
Q_ARG
(
QUrl
,
url
),
Q_ARG
(
QString
,
deviceUdi
)
);
QMetaObject
::
invokeMethod
(
dialog
,
[
dialog
,
url
,
deviceUdi
]()
{
dialog
->
setSourceUrl
(
url
,
deviceUdi
);
},
Qt
::
QueuedConnection
);
return
app
.
exec
();
}
lib/contextmanager.cpp
View file @
8d62b127
...
...
@@ -331,7 +331,7 @@ void ContextManager::slotRowsInserted()
// thumbnail bar is visible, the image will not be selected in the thumbnail
// bar.
if
(
d
->
mUrlToSelect
.
isValid
())
{
QMetaObject
::
invokeMethod
(
this
,
"
selectUrlToSelect
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
ContextManager
::
selectUrlToSelect
,
Qt
::
QueuedConnection
);
}
}
...
...
lib/document/documentjob.cpp
View file @
8d62b127
...
...
@@ -69,7 +69,7 @@ void DocumentJob::setDocument(const Document::Ptr& doc)
void
DocumentJob
::
start
()
{
QMetaObject
::
invokeMethod
(
this
,
"
doStart
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
DocumentJob
::
doStart
,
Qt
::
QueuedConnection
);
}
bool
DocumentJob
::
checkDocumentEditor
()
...
...
lib/documentview/documentview.cpp
View file @
8d62b127
...
...
@@ -561,7 +561,7 @@ void DocumentView::openUrl(const QUrl &url, const DocumentView::Setup& setup)
connect
(
d
->
mDocument
.
data
(),
&
Document
::
kindDetermined
,
this
,
&
DocumentView
::
finishOpenUrl
);
}
else
{
QMetaObject
::
invokeMethod
(
this
,
"
finishOpenUrl
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
DocumentView
::
finishOpenUrl
,
Qt
::
QueuedConnection
);
}
d
->
setupBirdEyeView
();
}
...
...
@@ -1040,7 +1040,7 @@ bool DocumentView::sceneEventFilter(QGraphicsItem*, QEvent* event)
if
(
mouseEvent
->
button
()
==
Qt
::
LeftButton
)
{
d
->
mDragStartPosition
=
mouseEvent
->
pos
();
}
QMetaObject
::
invokeMethod
(
this
,
"
emitFocused
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
DocumentView
::
emitFocused
,
Qt
::
QueuedConnection
);
}
else
if
(
event
->
type
()
==
QEvent
::
GraphicsSceneHoverMove
)
{
if
(
d
->
mBirdEyeView
)
{
d
->
mBirdEyeView
->
onMouseMoved
();
...
...
lib/documentview/documentviewcontainer.cpp
View file @
8d62b127
...
...
@@ -277,7 +277,7 @@ void DocumentViewContainer::updateLayout()
for
(
DocumentView
*
view
:
qAsConst
(
d
->
mRemovedViews
))
{
view
->
deleteLater
();
}
QMetaObject
::
invokeMethod
(
this
,
"
pretendFadeInFinished
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
DocumentViewContainer
::
pretendFadeInFinished
,
Qt
::
QueuedConnection
);
}
d
->
mRemovedViews
.
clear
();
}
...
...
lib/documentview/rasterimageview.cpp
View file @
8d62b127
...
...
@@ -273,7 +273,7 @@ void RasterImageView::loadFromDocument()
void
RasterImageView
::
slotDocumentMetaInfoLoaded
()
{
if
(
document
()
->
size
().
isValid
())
{
QMetaObject
::
invokeMethod
(
this
,
"
finishSetDocument
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
RasterImageView
::
finishSetDocument
,
Qt
::
QueuedConnection
);
}
else
{
// Could not retrieve image size from meta info, we need to load the
// full image now.
...
...
lib/documentview/svgviewadapter.cpp
View file @
8d62b127
...
...
@@ -63,7 +63,7 @@ void SvgImageView::loadFromDocument()
GV_RETURN_IF_FAIL
(
doc
);
if
(
doc
->
loadingState
()
==
Document
::
Loaded
)
{
QMetaObject
::
invokeMethod
(
this
,
"
finishLoadFromDocument
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
SvgImageView
::
finishLoadFromDocument
,
Qt
::
QueuedConnection
);
}
// Ensure finishLoadFromDocument is also called when
...
...
lib/documentview/videoviewadapter.cpp
View file @
8d62b127
...
...
@@ -243,7 +243,7 @@ void VideoViewAdapter::setDocument(const Document::Ptr &doc)
// If we do not use a queued connection, the signal arrives too early,
// preventing the listing of the dir content when Gwenview is started with
// a video as an argument.
QMetaObject
::
invokeMethod
(
this
,
"
completed
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
VideoViewAdapter
::
completed
,
Qt
::
QueuedConnection
);
}
Document
::
Ptr
VideoViewAdapter
::
document
()
const
...
...
lib/mpris2/dbusabstractadaptor.cpp
View file @
8d62b127
...
...
@@ -42,7 +42,7 @@ void DBusAbstractAdaptor::signalPropertyChange(const QString &propertyName, cons
if
(
firstChange
)
{
// trigger signal emission on next event loop
QMetaObject
::
invokeMethod
(
this
,
"
emitPropertiesChangeDBusSignal
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
DBusAbstractAdaptor
::
emitPropertiesChangeDBusSignal
,
Qt
::
QueuedConnection
);
}
}
...
...
lib/thumbnailprovider/thumbnailprovider.cpp
View file @
8d62b127
...
...
@@ -315,7 +315,7 @@ void ThumbnailProvider::determineNextIcon()
if
(
UrlUtils
::
urlIsFastLocalFile
(
mCurrentUrl
))
{
QFileInfo
fileInfo
(
mCurrentUrl
.
toLocalFile
());
mOriginalTime
=
fileInfo
.
lastModified
().
toSecsSinceEpoch
();
QMetaObject
::
invokeMethod
(
this
,
"
checkThumbnail
"
,
Qt
::
QueuedConnection
);
QMetaObject
::
invokeMethod
(
this
,
&
ThumbnailProvider
::
checkThumbnail
,
Qt
::
QueuedConnection
);
}
else
{
KIO
::
Job
*
job
=
KIO
::
stat
(
mCurrentUrl
,
KIO
::
HideProgressInfo
);
KJobWidgets
::
setWindow
(
job
,
qApp
->
activeWindow
());
...
...
tests/auto/documenttest.cpp
View file @
8d62b127
...
...
@@ -797,7 +797,7 @@ void DocumentTest::testUndoStackPush()
protected:
void
redo
()
override
{
QMetaObject
::
invokeMethod
(
this
,
"finish"
,
Qt
::
QueuedConnection
,
Q_ARG
(
bool
,
true
)
);
QMetaObject
::
invokeMethod
(
this
,
[
this
]()
{
finish
(
true
);
}
,
Qt
::
QueuedConnection
);
}
};
...
...
@@ -806,7 +806,7 @@ void DocumentTest::testUndoStackPush()
protected:
void
redo
()
override
{
QMetaObject
::
invokeMethod
(
this
,
"finish"
,
Qt
::
QueuedConnection
,
Q_ARG
(
bool
,
false
)
);
QMetaObject
::
invokeMethod
(
this
,
[
this
]()
{
finish
(
false
);
}
,
Qt
::
QueuedConnection
);
}
};
...
...
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