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
System
Dolphin
Commits
9d11e5d4
Commit
9d11e5d4
authored
May 05, 2019
by
Elvis Angelaccio
Browse files
Get rid of ugly static_cast usages in connect() calls
parent
957a6f4f
Changes
16
Hide whitespace changes
Inline
Side-by-side
src/dolphinmainwindow.cpp
View file @
9d11e5d4
...
...
@@ -111,7 +111,7 @@ DolphinMainWindow::DolphinMainWindow() :
KIO
::
FileUndoManager
*
undoManager
=
KIO
::
FileUndoManager
::
self
();
undoManager
->
setUiInterface
(
new
UndoUiInterface
());
connect
(
undoManager
,
static_cast
<
void
(
KIO
::
FileUndoManager
::*
)(
bool
)
>
(
&
KIO
::
FileUndoManager
::
undoAvailable
),
connect
(
undoManager
,
QOverload
<
bool
>::
of
(
&
KIO
::
FileUndoManager
::
undoAvailable
),
this
,
&
DolphinMainWindow
::
slotUndoAvailable
);
connect
(
undoManager
,
&
KIO
::
FileUndoManager
::
undoTextChanged
,
this
,
&
DolphinMainWindow
::
slotUndoTextChanged
);
...
...
@@ -1122,10 +1122,9 @@ void DolphinMainWindow::setupActions()
newTab
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"tab-new"
)));
newTab
->
setText
(
i18nc
(
"@action:inmenu File"
,
"New Tab"
));
actionCollection
()
->
setDefaultShortcuts
(
newTab
,
{
Qt
::
CTRL
+
Qt
::
Key_T
,
Qt
::
CTRL
+
Qt
::
SHIFT
+
Qt
::
Key_N
});
connect
(
newTab
,
&
QAction
::
triggered
,
this
,
static_cast
<
void
(
DolphinMainWindow
::*
)()
>
(
&
DolphinMainWindow
::
openNewActivatedTab
)
)
;
connect
(
newTab
,
&
QAction
::
triggered
,
this
,
&
DolphinMainWindow
::
openNewActivatedTab
);
QAction
*
closeTab
=
KStandardAction
::
close
(
m_tabWidget
,
static_cast
<
void
(
DolphinTabWidget
::*
)()
>
(
&
DolphinTabWidget
::
closeTab
),
actionCollection
());
QAction
*
closeTab
=
KStandardAction
::
close
(
m_tabWidget
,
QOverload
<>::
of
(
&
DolphinTabWidget
::
closeTab
),
actionCollection
());
closeTab
->
setText
(
i18nc
(
"@action:inmenu File"
,
"Close Tab"
));
KStandardAction
::
quit
(
this
,
&
DolphinMainWindow
::
quit
,
actionCollection
());
...
...
@@ -1601,9 +1600,9 @@ void DolphinMainWindow::connectViewSignals(DolphinViewContainer* container)
connect
(
view
,
&
DolphinView
::
directoryLoadingCompleted
,
this
,
&
DolphinMainWindow
::
slotDirectoryLoadingCompleted
);
connect
(
view
,
&
DolphinView
::
goBackRequested
,
this
,
static_cast
<
void
(
DolphinMainWindow
::*
)()
>
(
&
DolphinMainWindow
::
goBack
)
)
;
this
,
&
DolphinMainWindow
::
goBack
);
connect
(
view
,
&
DolphinView
::
goForwardRequested
,
this
,
static_cast
<
void
(
DolphinMainWindow
::*
)()
>
(
&
DolphinMainWindow
::
goForward
)
)
;
this
,
&
DolphinMainWindow
::
goForward
);
connect
(
view
,
&
DolphinView
::
urlActivated
,
this
,
&
DolphinMainWindow
::
handleUrl
);
...
...
src/dolphinpart.cpp
View file @
9d11e5d4
...
...
@@ -76,7 +76,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
connect
(
&
DolphinNewFileMenuObserver
::
instance
(),
&
DolphinNewFileMenuObserver
::
errorMessage
,
this
,
&
DolphinPart
::
slotErrorMessage
);
connect
(
m_view
,
&
DolphinView
::
directoryLoadingCompleted
,
this
,
static_cast
<
void
(
Dolphin
Part
::
*
)()
>
(
&
Dolphin
Part
::
completed
));
connect
(
m_view
,
&
DolphinView
::
directoryLoadingCompleted
,
this
,
QOverload
<>::
of
(
&
K
Part
s
::
ReadOnly
Part
::
completed
));
connect
(
m_view
,
&
DolphinView
::
directoryLoadingCompleted
,
this
,
&
DolphinPart
::
updatePasteAction
);
connect
(
m_view
,
&
DolphinView
::
directoryLoadingProgress
,
this
,
&
DolphinPart
::
updateProgress
);
connect
(
m_view
,
&
DolphinView
::
errorMessage
,
this
,
&
DolphinPart
::
slotErrorMessage
);
...
...
@@ -98,7 +98,7 @@ DolphinPart::DolphinPart(QWidget* parentWidget, QObject* parent, const QVariantL
connect
(
m_view
,
&
DolphinView
::
requestContextMenu
,
this
,
&
DolphinPart
::
slotOpenContextMenu
);
connect
(
m_view
,
&
DolphinView
::
selectionChanged
,
m_extension
,
static_cast
<
void
(
DolphinPartBrowserExtension
::*
)(
const
KFileItemList
&
)
>
(
&
Dolphin
PartBrowserExtension
::
selectionInfo
));
m_extension
,
QOverload
<
const
KFileItemList
&
>::
of
(
&
K
Part
s
::
BrowserExtension
::
selectionInfo
));
connect
(
m_view
,
&
DolphinView
::
selectionChanged
,
this
,
&
DolphinPart
::
slotSelectionChanged
);
connect
(
m_view
,
&
DolphinView
::
requestItemInfo
,
...
...
src/dolphintabwidget.cpp
View file @
9d11e5d4
...
...
@@ -37,13 +37,13 @@ DolphinTabWidget::DolphinTabWidget(QWidget* parent) :
m_lastViewedTab
(
0
)
{
connect
(
this
,
&
DolphinTabWidget
::
tabCloseRequested
,
this
,
static_cast
<
void
(
DolphinTabWidget
::*
)(
int
)
>
(
&
DolphinTabWidget
::
closeTab
));
this
,
QOverload
<
int
>::
of
(
&
DolphinTabWidget
::
closeTab
));
connect
(
this
,
&
DolphinTabWidget
::
currentChanged
,
this
,
&
DolphinTabWidget
::
currentTabChanged
);
DolphinTabBar
*
tabBar
=
new
DolphinTabBar
(
this
);
connect
(
tabBar
,
&
DolphinTabBar
::
openNewActivatedTab
,
this
,
static_cast
<
void
(
DolphinTabWidget
::*
)(
int
)
>
(
&
DolphinTabWidget
::
openNewActivatedTab
));
this
,
QOverload
<
int
>::
of
(
&
DolphinTabWidget
::
openNewActivatedTab
));
connect
(
tabBar
,
&
DolphinTabBar
::
tabDropEvent
,
this
,
&
DolphinTabWidget
::
tabDropEvent
);
connect
(
tabBar
,
&
DolphinTabBar
::
tabDetachRequested
,
...
...
src/kitemviews/kfileitemmodel.cpp
View file @
9d11e5d4
...
...
@@ -68,16 +68,16 @@ KFileItemModel::KFileItemModel(QObject* parent) :
}
connect
(
m_dirLister
,
&
KFileItemModelDirLister
::
started
,
this
,
&
KFileItemModel
::
directoryLoadingStarted
);
connect
(
m_dirLister
,
static_cast
<
void
(
KFileItemModelDirLister
::*
)()
>
(
&
KFileItemModel
DirLister
::
canceled
),
this
,
&
KFileItemModel
::
slotCanceled
);
connect
(
m_dirLister
,
static_cast
<
void
(
KFileItemModelDirLister
::*
)(
const
QUrl
&
)
>
(
&
KFileItemModel
DirLister
::
completed
),
this
,
&
KFileItemModel
::
slotCompleted
);
connect
(
m_dirLister
,
QOverload
<>::
of
(
&
KCore
DirLister
::
canceled
),
this
,
&
KFileItemModel
::
slotCanceled
);
connect
(
m_dirLister
,
QOverload
<
const
QUrl
&>::
of
(
&
KCore
DirLister
::
completed
),
this
,
&
KFileItemModel
::
slotCompleted
);
connect
(
m_dirLister
,
&
KFileItemModelDirLister
::
itemsAdded
,
this
,
&
KFileItemModel
::
slotItemsAdded
);
connect
(
m_dirLister
,
&
KFileItemModelDirLister
::
itemsDeleted
,
this
,
&
KFileItemModel
::
slotItemsDeleted
);
connect
(
m_dirLister
,
&
KFileItemModelDirLister
::
refreshItems
,
this
,
&
KFileItemModel
::
slotRefreshItems
);
connect
(
m_dirLister
,
static_cast
<
void
(
KFileItemModelDirLister
::*
)()
>
(
&
KFileItemModel
DirLister
::
clear
),
this
,
&
KFileItemModel
::
slotClear
);
connect
(
m_dirLister
,
QOverload
<>::
of
(
&
KCore
DirLister
::
clear
),
this
,
&
KFileItemModel
::
slotClear
);
connect
(
m_dirLister
,
&
KFileItemModelDirLister
::
infoMessage
,
this
,
&
KFileItemModel
::
infoMessage
);
connect
(
m_dirLister
,
&
KFileItemModelDirLister
::
errorMessage
,
this
,
&
KFileItemModel
::
errorMessage
);
connect
(
m_dirLister
,
&
KFileItemModelDirLister
::
percent
,
this
,
&
KFileItemModel
::
directoryLoadingProgress
);
connect
(
m_dirLister
,
static_cast
<
void
(
KFileItemModelDirLister
::*
)(
const
QUrl
&
,
const
QUrl
&
)
>
(
&
KFileItemModel
DirLister
::
redirection
),
this
,
&
KFileItemModel
::
directoryRedirection
);
connect
(
m_dirLister
,
QOverload
<
const
QUrl
&
,
const
QUrl
&
>::
of
(
&
KCore
DirLister
::
redirection
),
this
,
&
KFileItemModel
::
directoryRedirection
);
connect
(
m_dirLister
,
&
KFileItemModelDirLister
::
urlIsFileError
,
this
,
&
KFileItemModel
::
urlIsFileError
);
// Apply default roles that should be determined
...
...
src/panels/information/pixmapviewer.cpp
View file @
9d11e5d4
...
...
@@ -37,7 +37,7 @@ PixmapViewer::PixmapViewer(QWidget* parent, Transition transition) :
m_animation
.
setCurveShape
(
QTimeLine
::
LinearCurve
);
if
(
m_transition
!=
NoTransition
)
{
connect
(
&
m_animation
,
&
QTimeLine
::
valueChanged
,
this
,
static_cast
<
void
(
PixmapViewer
::*
)()
>
(
&
PixmapViewer
::
update
));
connect
(
&
m_animation
,
&
QTimeLine
::
valueChanged
,
this
,
QOverload
<>::
of
(
&
PixmapViewer
::
update
));
connect
(
&
m_animation
,
&
QTimeLine
::
finished
,
this
,
&
PixmapViewer
::
checkPendingPixmaps
);
}
}
...
...
src/settings/general/previewssettingspage.cpp
View file @
9d11e5d4
...
...
@@ -85,7 +85,7 @@ PreviewsSettingsPage::PreviewsSettingsPage(QWidget* parent) :
loadSettings
();
connect
(
m_listView
,
&
QListView
::
clicked
,
this
,
&
PreviewsSettingsPage
::
changed
);
connect
(
m_remoteFileSizeBox
,
static_cast
<
void
(
QSpinBox
::*
)(
int
)
>
(
&
QSpinBox
::
valueChanged
),
this
,
&
PreviewsSettingsPage
::
changed
);
connect
(
m_remoteFileSizeBox
,
QOverload
<
int
>::
of
(
&
QSpinBox
::
valueChanged
),
this
,
&
PreviewsSettingsPage
::
changed
);
}
PreviewsSettingsPage
::~
PreviewsSettingsPage
()
...
...
src/settings/kcm/kcmdolphingeneral.cpp
View file @
9d11e5d4
...
...
@@ -48,17 +48,17 @@ DolphinGeneralConfigModule::DolphinGeneralConfigModule(QWidget* parent, const QV
// initialize 'Behavior' tab
BehaviorSettingsPage
*
behaviorPage
=
new
BehaviorSettingsPage
(
QUrl
::
fromLocalFile
(
QDir
::
homePath
()),
tabWidget
);
tabWidget
->
addTab
(
behaviorPage
,
i18nc
(
"@title:tab Behavior settings"
,
"Behavior"
));
connect
(
behaviorPage
,
&
BehaviorSettingsPage
::
changed
,
this
,
static_cast
<
void
(
DolphinGeneralConfigModule
::*
)()
>
(
&
DolphinGeneralConfigModule
::
changed
));
connect
(
behaviorPage
,
&
BehaviorSettingsPage
::
changed
,
this
,
QOverload
<>::
of
(
&
DolphinGeneralConfigModule
::
changed
));
// initialize 'Previews' tab
PreviewsSettingsPage
*
previewsPage
=
new
PreviewsSettingsPage
(
tabWidget
);
tabWidget
->
addTab
(
previewsPage
,
i18nc
(
"@title:tab Previews settings"
,
"Previews"
));
connect
(
previewsPage
,
&
PreviewsSettingsPage
::
changed
,
this
,
static_cast
<
void
(
DolphinGeneralConfigModule
::*
)()
>
(
&
DolphinGeneralConfigModule
::
changed
));
connect
(
previewsPage
,
&
PreviewsSettingsPage
::
changed
,
this
,
QOverload
<>::
of
(
&
DolphinGeneralConfigModule
::
changed
));
// initialize 'Confirmations' tab
ConfirmationsSettingsPage
*
confirmationsPage
=
new
ConfirmationsSettingsPage
(
tabWidget
);
tabWidget
->
addTab
(
confirmationsPage
,
i18nc
(
"@title:tab Confirmations settings"
,
"Confirmations"
));
connect
(
confirmationsPage
,
&
ConfirmationsSettingsPage
::
changed
,
this
,
static_cast
<
void
(
DolphinGeneralConfigModule
::*
)()
>
(
&
DolphinGeneralConfigModule
::
changed
));
connect
(
confirmationsPage
,
&
ConfirmationsSettingsPage
::
changed
,
this
,
QOverload
<>::
of
(
&
DolphinGeneralConfigModule
::
changed
));
m_pages
.
append
(
behaviorPage
);
m_pages
.
append
(
previewsPage
);
...
...
src/settings/kcm/kcmdolphinnavigation.cpp
View file @
9d11e5d4
...
...
@@ -40,7 +40,7 @@ DolphinNavigationConfigModule::DolphinNavigationConfigModule(QWidget* parent, co
topLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_navigation
=
new
NavigationSettingsPage
(
this
);
connect
(
m_navigation
,
&
NavigationSettingsPage
::
changed
,
this
,
static_cast
<
void
(
DolphinNavigationConfigModule
::*
)()
>
(
&
DolphinNavigationConfigModule
::
changed
));
connect
(
m_navigation
,
&
NavigationSettingsPage
::
changed
,
this
,
QOverload
<>::
of
(
&
DolphinNavigationConfigModule
::
changed
));
topLayout
->
addWidget
(
m_navigation
,
0
,
nullptr
);
}
...
...
src/settings/kcm/kcmdolphinservices.cpp
View file @
9d11e5d4
...
...
@@ -40,7 +40,7 @@ DolphinServicesConfigModule::DolphinServicesConfigModule(QWidget* parent, const
topLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_services
=
new
ServicesSettingsPage
(
this
);
connect
(
m_services
,
&
ServicesSettingsPage
::
changed
,
this
,
static_cast
<
void
(
DolphinServicesConfigModule
::*
)()
>
(
&
DolphinServicesConfigModule
::
changed
));
connect
(
m_services
,
&
ServicesSettingsPage
::
changed
,
this
,
QOverload
<>::
of
(
&
DolphinServicesConfigModule
::
changed
));
topLayout
->
addWidget
(
m_services
,
0
,
nullptr
);
}
...
...
src/settings/trash/trashsettingspage.cpp
View file @
9d11e5d4
...
...
@@ -33,7 +33,7 @@ TrashSettingsPage::TrashSettingsPage(QWidget* parent) :
loadSettings
();
connect
(
m_proxy
,
static_cast
<
void
(
KCModuleProxy
::*
)(
bool
)
>
(
&
KCModuleProxy
::
changed
),
this
,
&
TrashSettingsPage
::
changed
);
connect
(
m_proxy
,
QOverload
<
bool
>::
of
(
&
KCModuleProxy
::
changed
),
this
,
&
TrashSettingsPage
::
changed
);
}
TrashSettingsPage
::~
TrashSettingsPage
()
...
...
src/settings/viewmodes/dolphinfontrequester.cpp
View file @
9d11e5d4
...
...
@@ -40,7 +40,7 @@ DolphinFontRequester::DolphinFontRequester(QWidget* parent) :
m_modeCombo
=
new
QComboBox
(
this
);
m_modeCombo
->
addItem
(
i18nc
(
"@item:inlistbox Font"
,
"System Font"
));
m_modeCombo
->
addItem
(
i18nc
(
"@item:inlistbox Font"
,
"Custom Font"
));
connect
(
m_modeCombo
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
activated
),
connect
(
m_modeCombo
,
QOverload
<
int
>::
of
(
&
QComboBox
::
activated
),
this
,
&
DolphinFontRequester
::
changeMode
);
m_chooseFontButton
=
new
QPushButton
(
i18nc
(
"@action:button Choose font"
,
"Choose..."
),
this
);
...
...
src/settings/viewmodes/viewsettingstab.cpp
View file @
9d11e5d4
...
...
@@ -120,11 +120,11 @@ ViewSettingsTab::ViewSettingsTab(Mode mode, QWidget* parent) :
switch
(
m_mode
)
{
case
IconsMode
:
connect
(
m_widthBox
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewSettingsTab
::
changed
);
connect
(
m_maxLinesBox
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewSettingsTab
::
changed
);
connect
(
m_widthBox
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewSettingsTab
::
changed
);
connect
(
m_maxLinesBox
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewSettingsTab
::
changed
);
break
;
case
CompactMode
:
connect
(
m_widthBox
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewSettingsTab
::
changed
);
connect
(
m_widthBox
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewSettingsTab
::
changed
);
break
;
case
DetailsMode
:
connect
(
m_expandableFolders
,
&
QCheckBox
::
toggled
,
this
,
&
ViewSettingsTab
::
changed
);
...
...
src/settings/viewpropertiesdialog.cpp
View file @
9d11e5d4
...
...
@@ -163,11 +163,11 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
layout
->
addRow
(
QString
(),
m_showInGroups
);
layout
->
addRow
(
QString
(),
m_showHiddenFiles
);
connect
(
m_viewMode
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
connect
(
m_viewMode
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewPropertiesDialog
::
slotViewModeChanged
);
connect
(
m_sorting
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
connect
(
m_sorting
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewPropertiesDialog
::
slotSortingChanged
);
connect
(
m_sortOrder
,
static_cast
<
void
(
QComboBox
::*
)(
int
)
>
(
&
QComboBox
::
currentIndexChanged
),
connect
(
m_sortOrder
,
QOverload
<
int
>::
of
(
&
QComboBox
::
currentIndexChanged
),
this
,
&
ViewPropertiesDialog
::
slotSortOrderChanged
);
connect
(
m_sortFoldersFirst
,
&
QCheckBox
::
clicked
,
this
,
&
ViewPropertiesDialog
::
slotSortFoldersFirstChanged
);
...
...
src/trash/dolphintrash.cpp
View file @
9d11e5d4
...
...
@@ -40,7 +40,7 @@ Trash::Trash()
bool
isTrashEmpty
=
m_trashDirLister
->
items
().
isEmpty
();
emit
emptinessChanged
(
isTrashEmpty
);
};
connect
(
m_trashDirLister
,
static_cast
<
void
(
KDirLister
::*
)()
>
(
&
K
DirLister
::
completed
),
this
,
trashDirContentChanged
);
connect
(
m_trashDirLister
,
QOverload
<>::
of
(
&
KCore
DirLister
::
completed
),
this
,
trashDirContentChanged
);
connect
(
m_trashDirLister
,
&
KDirLister
::
itemsDeleted
,
this
,
trashDirContentChanged
);
m_trashDirLister
->
openUrl
(
QUrl
(
QStringLiteral
(
"trash:/"
)));
}
...
...
src/views/dolphinviewactionhandler.cpp
View file @
9d11e5d4
...
...
@@ -144,7 +144,7 @@ void DolphinViewActionHandler::createActions()
viewModeActions
->
addAction
(
compactAction
);
viewModeActions
->
addAction
(
detailsAction
);
viewModeActions
->
setToolBarMode
(
KSelectAction
::
MenuMode
);
connect
(
viewModeActions
,
static_cast
<
void
(
KSelectAction
::*
)(
QAction
*
)
>
(
&
KSelectAction
::
triggered
),
this
,
&
DolphinViewActionHandler
::
slotViewModeActionTriggered
);
connect
(
viewModeActions
,
QOverload
<
QAction
*>
::
of
(
&
KSelectAction
::
triggered
),
this
,
&
DolphinViewActionHandler
::
slotViewModeActionTriggered
);
KStandardAction
::
zoomIn
(
this
,
&
DolphinViewActionHandler
::
zoomIn
,
...
...
src/views/tooltips/tooltipmanager.cpp
View file @
9d11e5d4
...
...
@@ -64,7 +64,7 @@ ToolTipManager::ToolTipManager(QWidget* parent) :
m_showToolTipTimer
=
new
QTimer
(
this
);
m_showToolTipTimer
->
setSingleShot
(
true
);
m_showToolTipTimer
->
setInterval
(
500
);
connect
(
m_showToolTipTimer
,
&
QTimer
::
timeout
,
this
,
static_cast
<
void
(
ToolTipManager
::*
)()
>
(
&
ToolTipManager
::
showToolTip
));
connect
(
m_showToolTipTimer
,
&
QTimer
::
timeout
,
this
,
QOverload
<>::
of
(
&
ToolTipManager
::
showToolTip
));
m_contentRetrievalTimer
=
new
QTimer
(
this
);
m_contentRetrievalTimer
->
setSingleShot
(
true
);
...
...
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