[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/plasma/applets/quicklaunch
From: Sujith Haridasan <sujith.h () gmail ! com>
Date: 2009-05-22 14:44:19
Message-ID: 1243003459.831098.27712.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 971502 by sujithh:
Reverting the changes because of feature freeze :(
M +0 -69 quicklaunchApplet.cpp
M +0 -19 quicklaunchApplet.h
M +0 -5 quicklaunchIcon.cpp
M +0 -2 quicklaunchIcon.h
--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchApplet.cpp \
#971501:971502 @@ -24,7 +24,6 @@
#include <QGraphicsSceneDragDropEvent>
#include <QGraphicsWidget>
#include <QDrag>
-#include <QHash>
#include <QMouseEvent>
#include <QMimeData>
#include <QToolButton>
@@ -34,7 +33,6 @@
#include <KStandardDirs>
#include <KWindowSystem>
#include <KIconLoader>
-#include <KUrl>
#include <plasma/containment.h>
#include <plasma/dialog.h>
@@ -47,7 +45,6 @@
static const int s_defaultIconSize = 16;
static const int s_defaultSpacing = 2;
-
QuicklaunchApplet::QuicklaunchApplet(QObject *parent, const QVariantList &args)
: Plasma::Applet(parent, args),
m_layout(0),
@@ -61,8 +58,6 @@
m_dialogLayout(0),
m_addDialog(0),
m_rightClickedIcon(0),
- m_sortappAscending(0),
- m_sortappDescending(0),
m_addAction(0),
m_removeAction(0)
{
@@ -359,74 +354,10 @@
}
tempActions << m_removeAction;
}
-
- if (!m_sortappAscending) {
- m_sortappAscending = new QAction(KIcon("view-sort-ascending"), i18n("Sort \
Alphabetically (A to Z)"), this);
- connect(m_sortappAscending, SIGNAL(triggered(bool)), this, \
SLOT(ascendingSort()));
- }
- tempActions << m_sortappAscending;
- if (!m_sortappDescending) {
- m_sortappDescending = new QAction(KIcon("view-sort-descending"), i18n("Sort \
Alphabetically (Z to A)"), this);
- connect(m_sortappDescending, SIGNAL(triggered(bool)), this, \
SLOT(descendingSort()));
- }
- tempActions << m_sortappDescending;
-
return tempActions;
}
-void QuicklaunchApplet::ascendingSort()
-{
- sortQuicklaunch(AscendingSort);
-}
-
-void QuicklaunchApplet::descendingSort()
-{
- sortQuicklaunch(DescendingSort);
-}
-
-void QuicklaunchApplet::sortQuicklaunch(SortingOrder sortingorder)
-{
- QHash <QString,QString> quicklaunchHash;
- KUrl::List urls;
- QList<QString> sortedList;
- QList<QString> saveSortedUrlList;
-
- foreach (QuicklaunchIcon *icon, m_icons) {
- quicklaunchHash.insert(icon->appName(),icon->url().prettyUrl());
- }
- sortedList = quicklaunchHash.keys();
-
- qSort(sortedList);
-
- for (int i = 0; i < quicklaunchHash.size(); i++) {
- saveSortedUrlList.append(quicklaunchHash.value(sortedList.value(i)));
- }
-
- if (sortingorder == DescendingSort) {
- QList<QString> tempUrl;
-
- for (int i = saveSortedUrlList.size(); i > 0; i--) {
- tempUrl.append(saveSortedUrlList.takeLast());
- }
- saveSortedUrlList = tempUrl;
- }
-
- foreach (QuicklaunchIcon *icon, m_icons) {
- m_icons.removeAll(icon);
- icon->hide();
- icon->deleteLater();
- }
-
- foreach (const QString &desktopFile, saveSortedUrlList) {
- addProgram(-1, desktopFile);
- }
- performUiRefactor();
-
- KConfigGroup cg = config();
- cg.writeEntry("iconUrls", saveSortedUrlList);
-}
-
void QuicklaunchApplet::dropApp(QGraphicsSceneDragDropEvent *event, bool \
droppedOnDialog) {
int pos;
--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchApplet.h \
#971501:971502 @@ -64,13 +64,6 @@
* @return List of QAction pointers
*/
virtual QList<QAction*> contextActions(QuicklaunchIcon *icon = 0);
- /**
- * This enum is to know which sorting action has to be taken.
- */
- enum SortingOrder {
- AscendingSort,
- DescendingSort
- };
public slots:
void createConfigurationInterface(KConfigDialog *parent);
@@ -78,17 +71,7 @@
* Slot for showing the Add Icon interface
*/
void showAddInterface();
- /**
- * Slot for sorting the applications in the quicklaunch
- */
- void ascendingSort();
- void descendingSort();
- /**
- * Action of sorting is taken here.
- */
- void sortQuicklaunch(SortingOrder );
-
protected:
/**
* Overloaded method to save the state on exit
@@ -182,8 +165,6 @@
QAction* m_addAction;
QAction* m_removeAction;
- QAction* m_sortappAscending;
- QAction* m_sortappDescending;
};
#endif
--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchIcon.cpp \
#971501:971502 @@ -54,11 +54,6 @@
return m_appUrl;
}
-QString QuicklaunchIcon::appName()
-{
- return m_text;
-}
-
void QuicklaunchIcon::setIconSize(int px)
{
m_iconSize = px;
--- trunk/KDE/kdebase/workspace/plasma/applets/quicklaunch/quicklaunchIcon.h \
#971501:971502 @@ -54,8 +54,6 @@
*/
KUrl url() const;
- QString appName();
-
/**
* Set the size of the icon to be painted
* @param size the size in pxs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic