┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels
diff options
context:
space:
mode:
Diffstat (limited to 'src/panels')
-rw-r--r--src/panels/folders/folderspanel.cpp7
-rw-r--r--src/panels/folders/treeviewcontextmenu.cpp10
-rw-r--r--src/panels/information/newtagdialog.cpp20
3 files changed, 21 insertions, 16 deletions
diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp
index eb957f7b9..1e3bdb8a6 100644
--- a/src/panels/folders/folderspanel.cpp
+++ b/src/panels/folders/folderspanel.cpp
@@ -96,15 +96,16 @@ void FoldersPanel::rename(const KFileItem& item)
} else {
KFileItemList items;
items.append(item);
- RenameDialog dialog(this, items);
- if (dialog.exec() == QDialog::Accepted) {
- const QString& newName = dialog.newName();
+ QPointer<RenameDialog> dialog = new RenameDialog(this, items);
+ if (dialog->exec() == QDialog::Accepted) {
+ const QString newName = dialog->newName();
if (!newName.isEmpty()) {
KUrl newUrl = item.url();
newUrl.setFileName(newName);
KonqOperations::rename(this, item.url(), newUrl);
}
}
+ delete dialog;
}
}
diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp
index 3bc3ab9fe..32e92e05c 100644
--- a/src/panels/folders/treeviewcontextmenu.cpp
+++ b/src/panels/folders/treeviewcontextmenu.cpp
@@ -34,8 +34,9 @@
#include "folderspanel.h"
-#include <QtGui/QApplication>
-#include <QtGui/QClipboard>
+#include <QApplication>
+#include <QClipboard>
+#include <QPointer>
TreeViewContextMenu::TreeViewContextMenu(FoldersPanel* parent,
const KFileItem& fileInfo) :
@@ -182,8 +183,9 @@ void TreeViewContextMenu::deleteItem()
void TreeViewContextMenu::showProperties()
{
- KPropertiesDialog dialog(m_fileInfo.url(), m_parent);
- dialog.exec();
+ QPointer<KPropertiesDialog> dialog = new KPropertiesDialog(m_fileInfo.url(), m_parent);
+ dialog->exec();
+ delete dialog;
}
void TreeViewContextMenu::setShowHiddenFiles(bool show)
diff --git a/src/panels/information/newtagdialog.cpp b/src/panels/information/newtagdialog.cpp
index 8785d578c..05189ea48 100644
--- a/src/panels/information/newtagdialog.cpp
+++ b/src/panels/information/newtagdialog.cpp
@@ -64,17 +64,18 @@ void NewTagDialog::slotLabelChanged( const QString& text )
Nepomuk::Tag NewTagDialog::createTag( QWidget* parent )
{
- NewTagDialog dlg( parent );
- dlg.m_labelTitle->setText( i18nc( "@title:window", "Create New Tag" ) );
- dlg.m_labelTitle->setComment( i18nc( "@title:window subtitle to previous message", "with optional icon and description" ) );
- dlg.m_labelTitle->setPixmap( KIcon( "nepomuk" ).pixmap( 32, 32 ) );
+ QPointer<NewTagDialog> dlg = new NewTagDialog( parent );
+ dlg->m_labelTitle->setText( i18nc( "@title:window", "Create New Tag" ) );
+ dlg->m_labelTitle->setComment( i18nc( "@title:window subtitle to previous message", "with optional icon and description" ) );
+ dlg->m_labelTitle->setPixmap( KIcon( "nepomuk" ).pixmap( 32, 32 ) );
- dlg.m_editTagLabel->setFocus();
+ dlg->m_editTagLabel->setFocus();
- if ( dlg.exec() ) {
- QString name = dlg.m_editTagLabel->text();
- QString comment = dlg.m_editTagComment->text();
- QString icon = dlg.m_buttonTagIcon->icon();
+ if ( dlg->exec() ) {
+ QString name = dlg->m_editTagLabel->text();
+ QString comment = dlg->m_editTagComment->text();
+ QString icon = dlg->m_buttonTagIcon->icon();
+ delete dlg;
Nepomuk::Tag newTag( name );
newTag.setLabel( name );
@@ -88,6 +89,7 @@ Nepomuk::Tag NewTagDialog::createTag( QWidget* parent )
return newTag;
}
else {
+ delete dlg;
return Nepomuk::Tag();
}
}