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

List:       kde-commits
Subject:    KDE/kdebase/apps/konqueror/sidebar
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2008-10-19 21:02:23
Message-ID: 1224450143.466364.1358.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 873636 by aacid:

Do not store the KMenu, its slower but at least the title is set correctly, setting \
the title and icon of a kmenu title after creation does not work


 M  +12 -18    sidebar_widget.cpp  
 M  +1 -2      sidebar_widget.h  


--- trunk/KDE/kdebase/apps/konqueror/sidebar/sidebar_widget.cpp #873635:873636
@@ -283,8 +283,6 @@
         connect(m_menu, SIGNAL(aboutToShow()),
 		this, SLOT(aboutToShowConfigMenu()));
 
-	m_buttonPopup = 0;
-	m_buttonPopupTitle = 0;
 	addBackEnd *ab = new addBackEnd(this, \
addMenu,universalMode,currentProfile,"Sidebar_Widget-addBackEnd");  connect(ab, \
SIGNAL(updateNeeded()),  this, SLOT(updateButtons()));
@@ -788,22 +786,18 @@
 
 			if (m_currentButton)
 			{
-				if (!m_buttonPopup)
-				{
-					m_buttonPopup=new KMenu(this);
-					m_buttonPopupTitle = m_buttonPopup->addTitle(SmallIcon("unknown"), "");
-					m_buttonPopup->addAction(KIcon("edit-rename"), i18n("Set Name..."), this, \
SLOT(slotSetName())); // Item to open a dialog to change the name of the sidebar item \
                (by Pupeno)
-					m_buttonPopup->addAction(KIcon("internet-web-browser"), i18n("Set URL..."), \
                this, SLOT(slotSetURL()));
-					m_buttonPopup->addAction(KIcon("preferences-desktop-icons"), i18n("Set \
                Icon..."), this, SLOT(slotSetIcon()));
-					m_buttonPopup->addSeparator();
-					m_buttonPopup->addAction(KIcon("edit-delete"), i18n("Remove"), this, \
                SLOT(slotRemove()));
-					m_buttonPopup->addSeparator();
-					m_buttonPopup->addMenu(m_menu);
-				}
-				m_buttonPopup->setItemEnabled(2,!m_currentButton->URL.isEmpty());
-				m_buttonPopupTitle->setIcon(SmallIcon(m_currentButton->iconName));
-			        m_buttonPopupTitle->setText(m_currentButton->displayName);
-				m_buttonPopup->exec(QCursor::pos());
+				KMenu *buttonPopup=new KMenu(this);
+				buttonPopup->addTitle(SmallIcon(m_currentButton->iconName), \
m_currentButton->displayName); +				buttonPopup->addAction(KIcon("edit-rename"), \
i18n("Set Name..."), this, SLOT(slotSetName())); // Item to open a dialog to change \
the name of the sidebar item (by Pupeno) \
+				buttonPopup->addAction(KIcon("internet-web-browser"), i18n("Set URL..."), this, \
SLOT(slotSetURL())); +				buttonPopup->addAction(KIcon("preferences-desktop-icons"), \
i18n("Set Icon..."), this, SLOT(slotSetIcon())); +				buttonPopup->addSeparator();
+				buttonPopup->addAction(KIcon("edit-delete"), i18n("Remove"), this, \
SLOT(slotRemove())); +				buttonPopup->addSeparator();
+				buttonPopup->addMenu(m_menu);
+				buttonPopup->setItemEnabled(2,!m_currentButton->URL.isEmpty());
+				buttonPopup->exec(QCursor::pos());
+				delete buttonPopup;
 			}
 			return true;
 
--- trunk/KDE/kdebase/apps/konqueror/sidebar/sidebar_widget.h #873635:873636
@@ -191,8 +191,7 @@
 	KMultiTabBar *m_buttonBar;
 	QVector<ButtonInfo*> m_buttons;
 	QHBoxLayout *m_layout;
-	KMenu *m_buttonPopup;
-	QAction* m_buttonPopupTitle, *m_showTabLeft;
+	QAction *m_showTabLeft;
 	QMenu *m_menu;
 	QPointer<ButtonInfo> m_activeModule;
 	QPointer<ButtonInfo> m_currentButton;


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

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