[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kate/Applications/16.12] addons/katesql: Fix SQL plugin combobox to actually show on the toolbar
From:       Albert Astals Cid <aacid () kde ! org>
Date:       2016-11-30 22:59:53
Message-ID: E1cCDqz-00079Z-7x () code ! kde ! org
[Download RAW message or body]

Git commit 04a9ba13ebf279b8483377554cd1782661bbc5f8 by Albert Astals Cid.
Committed on 30/11/2016 at 22:59.
Pushed by aacid into branch 'Applications/16.12'.

Fix SQL plugin combobox to actually show on the toolbar

Summary: ↑

Test Plan: Tested, works better

Reviewers: #kate

Subscribers: kwrite-devel

Differential Revision: https://phabricator.kde.org/D3115

M  +5    -5    addons/katesql/katesqlview.cpp

https://commits.kde.org/kate/04a9ba13ebf279b8483377554cd1782661bbc5f8

diff --git a/addons/katesql/katesqlview.cpp b/addons/katesql/katesqlview.cpp
index 3743686..89901c4 100644
--- a/addons/katesql/katesqlview.cpp
+++ b/addons/katesql/katesqlview.cpp
@@ -75,11 +75,10 @@ KateSQLView::KateSQLView(KTextEditor::Plugin *plugin, KTextEditor::MainWindow *m
 
   m_schemaBrowserWidget = new SchemaBrowserWidget(m_schemaBrowserToolView, m_manager);
 
-  m_connectionsComboBox = new KComboBox(this);
+  m_connectionsComboBox = new KComboBox(false);
   m_connectionsComboBox->setEditable(false);
   m_connectionsComboBox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
   m_connectionsComboBox->setModel(m_manager->connectionModel());
-//   m_connectionsComboBox->setItemDelegate( new ConnectionDelegate(this) );
 
   setupActions();
 
@@ -140,9 +139,10 @@ void KateSQLView::setupActions()
   action->setIcon(  QIcon::fromTheme (QLatin1String ("view-refresh")) );
   connect( action , SIGNAL(triggered()) , this , SLOT(slotConnectionReconnect()) );
 
-  action = collection->addAction(QLatin1String ("connection_chooser"));
-  action->setText( i18nc("@action:intoolbar", "Connection") );
-  // FIXME KF5 action->setDefaultWidget(m_connectionsComboBox);
+  QWidgetAction *wa = new QWidgetAction(this);
+  collection->addAction(QLatin1String ("connection_chooser"), wa);
+  wa->setText( i18nc("@action:intoolbar", "Connection") );
+  wa->setDefaultWidget(m_connectionsComboBox);
 
   action = collection->addAction(QLatin1String ("query_run"));
   action->setText( i18nc("@action:inmenu", "Run query") );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic