summaryrefslogtreecommitdiff
blob: ff742921046bcfa50f6923179bc6bc99c16801f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From 7cfc3f74f00d13cfb1a43f01a7dbc0be486c0d47 Mon Sep 17 00:00:00 2001
From: Pino Toscano <pino@kde.org>
Date: Mon, 8 Oct 2018 07:42:41 +0200
Subject: User menu: do not attempt to load an empty file name

Do not try to install m_currentXmlFile in case it is empty, otherwise
QFile will (rightfully) warn that an empty file was passed.
---
 src/usermenu/usermenu.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/usermenu/usermenu.cpp b/src/usermenu/usermenu.cpp
index 7d1d5f5..f9e3d3c 100644
--- a/src/usermenu/usermenu.cpp
+++ b/src/usermenu/usermenu.cpp
@@ -190,7 +190,7 @@ void UserMenu::updateGUI()
     clear();
 
     // then install
-    if(installXml(m_currentXmlFile)) {
+    if(!m_currentXmlFile.isEmpty() && installXml(m_currentXmlFile)) {
         // add changed context menu to all existing views
         KileView::Manager* viewManager = m_ki->viewManager();
         int views = viewManager->textViewCount();
-- 
cgit v1.1