Commit 806620db authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Pass parent widget to file properties dialog

That way it's properly centered in the parent window
parent c46ea5bc
Pipeline #201852 passed with stage
in 14 minutes and 43 seconds
......@@ -39,10 +39,10 @@ void KateFileActions::openContainingFolder(KTextEditor::Document *doc)
KIO::highlightInFileManager({doc->url()});
}
void KateFileActions::openFilePropertiesDialog(KTextEditor::Document *doc)
void KateFileActions::openFilePropertiesDialog(QWidget *parent, KTextEditor::Document *doc)
{
KFileItem fileItem(doc->url());
QDialog *dlg = new KPropertiesDialog(fileItem);
QDialog *dlg = new KPropertiesDialog(fileItem, parent);
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->show();
}
......
......@@ -40,7 +40,7 @@ void openContainingFolder(KTextEditor::Document *document);
*/
void renameDocumentFile(QWidget *parent, KTextEditor::Document *document);
void openFilePropertiesDialog(KTextEditor::Document *document);
void openFilePropertiesDialog(QWidget *parent, KTextEditor::Document *document);
/**
* Asks the user if the file should really be deleted. If yes, the file
......
......@@ -352,7 +352,7 @@ void KateMainWindow::setupActions()
a->setText(i18n("Properties"));
connect(a, &QAction::triggered, KateApp::self()->documentManager(), [this]() {
auto &&view = viewManager()->activeView();
KateFileActions::openFilePropertiesDialog(view->document());
KateFileActions::openFilePropertiesDialog(this, view->document());
});
a->setWhatsThis(i18n("Deletes the file belonging to the current document."));
......
......@@ -962,7 +962,7 @@ void KateViewSpace::showContextMenu(int idx, const QPoint &globalPos)
} else if (choice == aOpenFolder) {
KateFileActions::openContainingFolder(doc);
} else if (choice == aFileProperties) {
KateFileActions::openFilePropertiesDialog(doc);
KateFileActions::openFilePropertiesDialog(this, doc);
} else if (choice == aRenameFile) {
KateFileActions::renameDocumentFile(this, doc);
} else if (choice == aDeleteFile) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment