Moved ProfileDialog from heap to stack

This commit is contained in:
Daniel Brunner
2018-11-18 15:24:03 +01:00
parent 10b6084a53
commit 074495baa4
3 changed files with 6 additions and 4 deletions

View File

@@ -33,7 +33,9 @@ ProfilePlugin::ProfilePlugin(QObject *parent) :
void ProfilePlugin::attachTo(MainWindow &mainWindow) void ProfilePlugin::attachTo(MainWindow &mainWindow)
{ {
auto dialog = new ProfileDialog(mainWindow.userInfo(), &mainWindow);
mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/profileplugin/images/profile.png")), mainWindow.menuTools()->addAction(QIcon(QStringLiteral(":/zeiterfassung/plugins/profileplugin/images/profile.png")),
tr("My profile"), dialog, &QDialog::open); tr("My profile"), &mainWindow, [&mainWindow](){
ProfileDialog dialog(mainWindow.userInfo(), &mainWindow);
dialog.exec();
});
} }

View File

@@ -97,7 +97,7 @@
<context> <context>
<name>ProfilePlugin</name> <name>ProfilePlugin</name>
<message> <message>
<location filename="../profileplugin.cpp" line="38"/> <location filename="../profileplugin.cpp" line="37"/>
<source>My profile</source> <source>My profile</source>
<translation>Mein Profil</translation> <translation>Mein Profil</translation>
</message> </message>

View File

@@ -97,7 +97,7 @@
<context> <context>
<name>ProfilePlugin</name> <name>ProfilePlugin</name>
<message> <message>
<location filename="../profileplugin.cpp" line="38"/> <location filename="../profileplugin.cpp" line="37"/>
<source>My profile</source> <source>My profile</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>