Processed: Re: Bug#570977: Please provide way to customize default favorites list for new users

2010-04-05 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 tags 570977 + patch
Bug #570977 [kdebase-workspace-bin] Please provide way to customize default 
favorites list for new users
Added tag(s) patch.
 thanks
Stopping processing here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


-- 
To UNSUBSCRIBE, email to debian-qt-kde-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/handler.s.c.127044784220696.transcr...@bugs.debian.org



Bug#570977: Please provide way to customize default favorites list for new users

2010-04-05 Thread Petter Reinholdtsen
tags 570977 + patch
thanks

Here is a draft patch based on the code in KDE 3
(/kdebase/kicker/kicker/core/containerarea.cpp).  I would very much
like input on the code used to locate the config file.  Is kickoff the
correct name for this system?  Is the file name default-favorites
good?  What about its location?  I believe it will put it under
/usr/share/apps/kickoff/default-favorites or
/usr/share/kde4/apps/kickoff/default-favorites, but have not verified
this.

diff -ur kdebase-workspace-4.3.4/plasma/applets/kickoff/core/favoritesmodel.cpp 
kdebase-workspace-4.3.4-pere/plasma/applets/kickoff/core/favoritesmodel.cpp
--- kdebase-workspace-4.3.4/plasma/applets/kickoff/core/favoritesmodel.cpp  
2009-05-14 19:26:34.0 +0200
+++ kdebase-workspace-4.3.4-pere/plasma/applets/kickoff/core/favoritesmodel.cpp 
2010-04-05 08:02:46.0 +0200
@@ -31,6 +31,7 @@
 #include KService
 #include kdebug.h
 #include KUrl
+#include KStandardDirs
 
 using namespace Kickoff;
 
@@ -105,7 +106,26 @@
 static QListQString defaultFavorites()
 {
 QListQString applications;
-applications  konqbrowser  kmail  systemsettings  
dolphin;
+
+   // XXX Is this the KDE 4 way of finding the path?
+   // XXX Is this a good location for the default-favorites file?
+   QFile f(KStandardDirs::locate(data, kickoff/default-favorites));
+   if (f.open(IO_ReadOnly))
+   {
+   QTextStream is(f);
+
+   while (!is.eof())
+   applications  is.readLine();
+
+   f.close();
+   }
+   else
+   {
+   applications  konqbrowser
+ kmail
+ systemsettings
+ dolphin;
+   }
 
 QListQString desktopFiles;
 

Happy hacking,
-- 
Petter Reinholdtsen



-- 
To UNSUBSCRIBE, email to debian-qt-kde-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100405061035.gq14...@login2.uio.no



Bug#570977: Please provide way to customize default favorites list for new users

2010-04-05 Thread Sune Vuorela
On Monday 05 April 2010 08:10:35 Petter Reinholdtsen wrote:
 tags 570977 + patch
 thanks
 
 Here is a draft patch based on the code in KDE 3
 (/kdebase/kicker/kicker/core/containerarea.cpp).  I would very much
 like input on the code used to locate the config file.  Is kickoff the
 correct name for this system? 

kickoff is the codename for the 'moderen' K menu.

 Is the file name default-favorites
 good?  What about its location?  I believe it will put it under
 /usr/share/apps/kickoff/default-favorites or
 /usr/share/kde4/apps/kickoff/default-favorites, but have not verified
 this.

I'm considering wether this should be treated as a possible configuration file 
and not as a data file.

In general, you can ask kstandarddirs where it looks for things with the kde4-
config command
kde4-config --path data
kde4-config --path config

All of these has more than one directory in its output, and the directories 
are looked up from left to right until the file is found.


I will also ask the relevant upstreamers to look over this patch.

-- 
Do you know how can I overclock the controller of the Ultra hard disk?

You must disable a directory for getting access over a graphic TCP connection.



-- 
To UNSUBSCRIBE, email to debian-qt-kde-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201004051141.39355.s...@vuorela.dk



Bug#570977: Please provide way to customize default favorites list for new users

2010-02-22 Thread Petter Reinholdtsen

Package:  kdebase-workspace-bin
Version:  4:4.3.4-3
User: debian-...@lists.debian.org
UserTags: debian-edu

In Debian Edu, we want to change the list of applications showing up
in the default favorites list for new users.  One way to do this is to
create a file kickoffrc, but this only allow us to replace the current
list, not only append to the current list.  Looking at the source, I
trace the default list to this function ion
plasma/applets/kickoff/core/favoritesmodel.cpp:

static QListQString defaultFavorites()
{
QListQString applications;
applications  konqbrowser  kmail  systemsettings  
dolphin;

QListQString desktopFiles;

foreach (const QString application, applications) {
KService::Ptr service = KService::serviceByStorageId(kde4- + 
application + 
.desktop);
if (service) {
desktopFiles  service-entryPath();
}
}

return desktopFiles;
}

The list of default entries are hardcoded in the source, as far as I
can see, to konqueror, kmail, system settings and the dolphin file
browser.  Can this code be changed to allow us to add some entries to
a directory that will show in in the default favorites list?

With KDE 3, we could do something similar for the KDE panel list by
adding a replacement share/apps/kicker/default-apps.  It would be
great if a similar or better feature is made available for KDE 4.


Happy hacking,
-- 
Petter Reinholdtsen



-- 
To UNSUBSCRIBE, email to debian-qt-kde-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/e1njape-0005nd...@login1.uio.no