summaryrefslogtreecommitdiffstats
path: root/src/app/mainWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/mainWindow.cpp')
-rw-r--r--src/app/mainWindow.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/app/mainWindow.cpp b/src/app/mainWindow.cpp
index 8e01fd5..159d84c 100644
--- a/src/app/mainWindow.cpp
+++ b/src/app/mainWindow.cpp
@@ -706,13 +706,19 @@ action( const char *name )
TDEActionCollection *actionCollection = nullptr;
TDEAction *action = nullptr;
- if( mainWindow = (MainWindow*)kapp->mainWidget() )
- if( actionCollection = mainWindow->actionCollection() )
- action = actionCollection->action( name );
+ mainWindow = dynamic_cast<MainWindow *>(kapp->mainWidget());
+ if (mainWindow)
+ {
+ actionCollection = mainWindow->actionCollection();
+ if (actionCollection)
+ {
+ action = actionCollection->action(name);
+ }
+ }
- Q_ASSERT( mainWindow );
- Q_ASSERT( actionCollection );
- Q_ASSERT( action );
+ Q_ASSERT(mainWindow);
+ Q_ASSERT(actionCollection);
+ Q_ASSERT(action);
return action;
}