summaryrefslogtreecommitdiff
path: root/library
Unidiff
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/applnk.cpp24
-rw-r--r--library/applnk.h1
-rw-r--r--library/lnkproperties.cpp31
-rw-r--r--library/lnkpropertiesbase_p.ui366
4 files changed, 364 insertions, 58 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp
index 44f3f58..a56da5d 100644
--- a/library/applnk.cpp
+++ b/library/applnk.cpp
@@ -1,1349 +1,1369 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#define QTOPIA_INTERNAL_MIMEEXT 21#define QTOPIA_INTERNAL_MIMEEXT
22#define QTOPIA_INTERNAL_PRELOADACCESS 22#define QTOPIA_INTERNAL_PRELOADACCESS
23#define QTOPIA_INTERNAL_APPLNKASSIGN 23#define QTOPIA_INTERNAL_APPLNKASSIGN
24 24
25#include "applnk.h" 25#include "applnk.h"
26 26
27#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
28#include <qpe/categories.h> 28#include <qpe/categories.h>
29#include <qpe/categoryselect.h> 29#include <qpe/categoryselect.h>
30#ifdef QWS 30#ifdef QWS
31#include <qpe/qcopenvelope_qws.h> 31#include <qpe/qcopenvelope_qws.h>
32#endif 32#endif
33#include <qpe/global.h> 33#include <qpe/global.h>
34#include <qpe/mimetype.h> 34#include <qpe/mimetype.h>
35#include <qpe/config.h> 35#include <qpe/config.h>
36#include <qpe/storage.h> 36#include <qpe/storage.h>
37#include <qpe/resource.h> 37#include <qpe/resource.h>
38 38
39#include <qdict.h> 39#include <qdict.h>
40#include <qdir.h> 40#include <qdir.h>
41#include <qregexp.h> 41#include <qregexp.h>
42 42
43#ifdef Q_WS_QWS 43#ifdef Q_WS_QWS
44#include <qgfx_qws.h> 44#include <qgfx_qws.h>
45#endif 45#endif
46 46
47#include <stdlib.h> 47#include <stdlib.h>
48 48
49int AppLnk::lastId = 5000; 49int AppLnk::lastId = 5000;
50 50
51static int smallSize = 14; 51static int smallSize = 14;
52static int bigSize = 32; 52static int bigSize = 32;
53 53
54static QString safeFileName(const QString& n) 54static QString safeFileName(const QString& n)
55{ 55{
56 QString safename=n; 56 QString safename=n;
57 safename.replace(QRegExp("[^0-9A-Za-z.]"),"_"); 57 safename.replace(QRegExp("[^0-9A-Za-z.]"),"_");
58 safename.replace(QRegExp("^[^A-Za-z]*"),""); 58 safename.replace(QRegExp("^[^A-Za-z]*"),"");
59 if ( safename.isEmpty() ) 59 if ( safename.isEmpty() )
60 safename = "_"; 60 safename = "_";
61 return safename; 61 return safename;
62} 62}
63 63
64static bool prepareDirectories(const QString& lf) 64static bool prepareDirectories(const QString& lf)
65{ 65{
66 if ( !QFile::exists(lf) ) { 66 if ( !QFile::exists(lf) ) {
67 // May need to create directories 67 // May need to create directories
68 QFileInfo fi(lf); 68 QFileInfo fi(lf);
69 if ( system(("mkdir -p "+fi.dirPath(TRUE))) ) 69 if ( system(("mkdir -p "+fi.dirPath(TRUE))) )
70 return FALSE; 70 return FALSE;
71 } 71 }
72 return TRUE; 72 return TRUE;
73} 73}
74 74
75class AppLnkPrivate 75class AppLnkPrivate
76{ 76{
77public: 77public:
78 /* the size of the Pixmap */ 78 /* the size of the Pixmap */
79 enum Size {Normal = 0, Big }; 79 enum Size {Normal = 0, Big };
80 AppLnkPrivate() { 80 AppLnkPrivate() {
81 /* we want one normal and one big item */ 81 /* we want one normal and one big item */
82 82
83 QPixmap pix; 83 QPixmap pix;
84 mPixmaps.insert(0, pix ); 84 mPixmaps.insert(0, pix );
85 mPixmaps.insert(1, pix); 85 mPixmaps.insert(1, pix);
86 } 86 }
87 87
88 QStringList mCatList; // always correct 88 QStringList mCatList; // always correct
89 QArray<int> mCat; // cached value; correct if not empty 89 QArray<int> mCat; // cached value; correct if not empty
90 QMap<int, QPixmap> mPixmaps; 90 QMap<int, QPixmap> mPixmaps;
91 91
92 void updateCatListFromArray() 92 void updateCatListFromArray()
93 { 93 {
94 Categories cat( 0 ); 94 Categories cat( 0 );
95 cat.load( categoryFileName() ); 95 cat.load( categoryFileName() );
96 mCatList = cat.labels("Document View",mCat); 96 mCatList = cat.labels("Document View",mCat);
97 } 97 }
98 98
99 void setCatArrayDirty() 99 void setCatArrayDirty()
100 { 100 {
101 mCat.resize(0); 101 mCat.resize(0);
102 } 102 }
103 103
104 void ensureCatArray() 104 void ensureCatArray()
105 { 105 {
106 if ( mCat.count() > 0 || mCatList.count()==0 ) 106 if ( mCat.count() > 0 || mCatList.count()==0 )
107 return; 107 return;
108 108
109 Categories cat( 0 ); 109 Categories cat( 0 );
110 cat.load( categoryFileName() ); 110 cat.load( categoryFileName() );
111 mCat.resize( mCatList.count() ); 111 mCat.resize( mCatList.count() );
112 int i; 112 int i;
113 QStringList::ConstIterator it; 113 QStringList::ConstIterator it;
114 for ( i = 0, it = mCatList.begin(); it != mCatList.end(); 114 for ( i = 0, it = mCatList.begin(); it != mCatList.end();
115 ++it, i++ ) { 115 ++it, i++ ) {
116 116
117 bool number; 117 bool number;
118 int id = (*it).toInt( &number ); 118 int id = (*it).toInt( &number );
119 if ( !number ) { 119 if ( !number ) {
120 id = cat.id( "Document View", *it ); 120 id = cat.id( "Document View", *it );
121 if ( id == 0 ) 121 if ( id == 0 )
122 id = cat.addCategory( "Document View", *it ); 122 id = cat.addCategory( "Document View", *it );
123 } 123 }
124 mCat[i] = id; 124 mCat[i] = id;
125 } 125 }
126 } 126 }
127}; 127};
128 128
129/*! 129/*!
130 \class AppLnk applnk.h 130 \class AppLnk applnk.h
131 \brief The AppLnk class represents an application available on the system. 131 \brief The AppLnk class represents an application available on the system.
132 132
133 Every Qtopia application \e app has a corresponding \e app.desktop 133 Every Qtopia application \e app has a corresponding \e app.desktop
134 file. When one of these files is read its data is stored as an 134 file. When one of these files is read its data is stored as an
135 AppLnk object. 135 AppLnk object.
136 136
137 The AppLnk class introduces some Qtopia-specific concepts, and 137 The AppLnk class introduces some Qtopia-specific concepts, and
138 provides a variety of functions, as described in the following 138 provides a variety of functions, as described in the following
139 sections. 139 sections.
140 \tableofcontents 140 \tableofcontents
141 141
142 \target Types 142 \target Types
143 \section1 Types 143 \section1 Types
144 144
145 Every AppLnk object has a \e type. For applications, games and 145 Every AppLnk object has a \e type. For applications, games and
146 settings the type is \c Application; for documents the 146 settings the type is \c Application; for documents the
147 type is the document's MIME type. 147 type is the document's MIME type.
148 148
149 \target files-and-links 149 \target files-and-links
150 \section1 Files and Links 150 \section1 Files and Links
151 151
152 When you create an AppLnk (or more likely, a \link doclnk.html 152 When you create an AppLnk (or more likely, a \link doclnk.html
153 DocLnk\endlink), you don't deal directly with filenames in the 153 DocLnk\endlink), you don't deal directly with filenames in the
154 filesystem. Instead you do this: 154 filesystem. Instead you do this:
155 \code 155 \code
156 DocLnk d; 156 DocLnk d;
157 d.setType("text/plain"); 157 d.setType("text/plain");
158 d.setName("My Nicely Named Document / Whatever"); // Yes, "/" is legal. 158 d.setName("My Nicely Named Document / Whatever"); // Yes, "/" is legal.
159 \endcode 159 \endcode
160 At this point, the file() and linkFile() are unknown. Normally 160 At this point, the file() and linkFile() are unknown. Normally
161 this is uninteresting, and the names become automatically known, 161 this is uninteresting, and the names become automatically known,
162 and more importantly, becomes reserved, when you ask what they are: 162 and more importantly, becomes reserved, when you ask what they are:
163 163
164 \code 164 \code
165 QString fn = d.file(); 165 QString fn = d.file();
166 \endcode 166 \endcode
167 This invents a filename, and creates the file on disk (an empty 167 This invents a filename, and creates the file on disk (an empty
168 reservation file) to prevent the name being used by another 168 reservation file) to prevent the name being used by another
169 application. 169 application.
170 170
171 In some circumstances, you don't want to create the file if it 171 In some circumstances, you don't want to create the file if it
172 doesn't already exist (e.g. in the Document tab, some of the \link 172 doesn't already exist (e.g. in the Document tab, some of the \link
173 doclnk.html DocLnk\endlink objects represented by icons are 173 doclnk.html DocLnk\endlink objects represented by icons are
174 DocLnk's created just for that view - they don't have 174 DocLnk's created just for that view - they don't have
175 corresponding \c .desktop files. To avoid littering empty 175 corresponding \c .desktop files. To avoid littering empty
176 reservation files around, we check in a few places to see whether 176 reservation files around, we check in a few places to see whether
177 the file really needs to exist). 177 the file really needs to exist).
178 178
179 \section1 Functionality 179 \section1 Functionality
180 180
181 AppLnk objects are created by calling the constructor with the 181 AppLnk objects are created by calling the constructor with the
182 name of a \e .desktop file. The object can be checked for validity 182 name of a \e .desktop file. The object can be checked for validity
183 using isValid(). 183 using isValid().
184 184
185 The following functions are used to set or retrieve information 185 The following functions are used to set or retrieve information
186 about the application: 186 about the application:
187 \table 187 \table
188 \header \i Get Function \i Set Function \i Short Description 188 \header \i Get Function \i Set Function \i Short Description
189 \row \i \l name() \i \l setName() \i application's name 189 \row \i \l name() \i \l setName() \i application's name
190 \row \i \l pixmap() \i \e none \i application's icon 190 \row \i \l pixmap() \i \e none \i application's icon
191 \row \i \l bigPixmap() \i \e none \i application's large icon 191 \row \i \l bigPixmap() \i \e none \i application's large icon
192 \row \i \e none \i setIcon() \i sets the icon's filename 192 \row \i \e none \i setIcon() \i sets the icon's filename
193 \row \i \l type() \i \l setType() \i see \link #Types Types\endlink above 193 \row \i \l type() \i \l setType() \i see \link #Types Types\endlink above
194 \row \i \l rotation() \i \e none \i 0, 90, 180 or 270 degrees 194 \row \i \l rotation() \i \e none \i 0, 90, 180 or 270 degrees
195 \row \i \l comment() \i \l setComment() \i text for the Details dialog 195 \row \i \l comment() \i \l setComment() \i text for the Details dialog
196 \row \i \l exec() \i \l setExec() \i executable's filename 196 \row \i \l exec() \i \l setExec() \i executable's filename
197 \row \i \l file() \i \e none \i document's filename 197 \row \i \l file() \i \e none \i document's filename
198 \row \i \l linkFile() \i \l setLinkFile()\i \e .desktop filename 198 \row \i \l linkFile() \i \l setLinkFile()\i \e .desktop filename
199 \row \i \l mimeTypes() \i \e none \i the mime types the application can view or edit 199 \row \i \l mimeTypes() \i \e none \i the mime types the application can view or edit
200 \row \i \l categories() \i \l setCategories()\i \e{see the function descriptions} 200 \row \i \l categories() \i \l setCategories()\i \e{see the function descriptions}
201 \row \i \l fileKnown() \i \e none \i see \link 201 \row \i \l fileKnown() \i \e none \i see \link
202#files-and-links Files and Links\endlink above 202#files-and-links Files and Links\endlink above
203 \row \i \l linkFileKnown() \i \e none \i see \link 203 \row \i \l linkFileKnown() \i \e none \i see \link
204#files-and-links Files and Links\endlink above 204#files-and-links Files and Links\endlink above
205 \row \i \l property() \i \l setProperty()\i any AppLnk property 205 \row \i \l property() \i \l setProperty()\i any AppLnk property
206 can be retrieved or set (if writeable) using these 206 can be retrieved or set (if writeable) using these
207 \endtable 207 \endtable
208 208
209 To save an AppLnk to disk use writeLink(). To execute the 209 To save an AppLnk to disk use writeLink(). To execute the
210 application that the AppLnk object refers to, use execute(). 210 application that the AppLnk object refers to, use execute().
211 211
212 AppLnk's can be deleted from disk using removeLinkFile(). To 212 AppLnk's can be deleted from disk using removeLinkFile(). To
213 remove both the link and the application's executable use 213 remove both the link and the application's executable use
214 removeFiles(). 214 removeFiles().
215 215
216 Icon sizes can be globally changed (but only for AppLnk objects 216 Icon sizes can be globally changed (but only for AppLnk objects
217 created after the calls) with setSmallIconSize() and 217 created after the calls) with setSmallIconSize() and
218 setBigIconSize(). 218 setBigIconSize().
219 219
220 \ingroup qtopiaemb 220 \ingroup qtopiaemb
221*/ 221*/
222 222
223/*! 223/*!
224 Sets the size used for small icons to \a small pixels. 224 Sets the size used for small icons to \a small pixels.
225 Only affects AppLnk objects created after the call. 225 Only affects AppLnk objects created after the call.
226 226
227 \sa smallIconSize() setIcon() 227 \sa smallIconSize() setIcon()
228*/ 228*/
229void AppLnk::setSmallIconSize(int small) 229void AppLnk::setSmallIconSize(int small)
230{ 230{
231 smallSize = small; 231 smallSize = small;
232} 232}
233 233
234/*! 234/*!
235 Returns the size used for small icons. 235 Returns the size used for small icons.
236 236
237 \sa setSmallIconSize() setIcon() 237 \sa setSmallIconSize() setIcon()
238*/ 238*/
239int AppLnk::smallIconSize() 239int AppLnk::smallIconSize()
240{ 240{
241 return smallSize; 241 return smallSize;
242} 242}
243 243
244 244
245/*! 245/*!
246 Sets the size used for large icons to \a big pixels. 246 Sets the size used for large icons to \a big pixels.
247 Only affects AppLnk objects created after the call. 247 Only affects AppLnk objects created after the call.
248 248
249 \sa bigIconSize() setIcon() 249 \sa bigIconSize() setIcon()
250*/ 250*/
251void AppLnk::setBigIconSize(int big) 251void AppLnk::setBigIconSize(int big)
252{ 252{
253 bigSize = big; 253 bigSize = big;
254} 254}
255 255
256/*! 256/*!
257 Returns the size used for large icons. 257 Returns the size used for large icons.
258 258
259 \sa setBigIconSize() setIcon() 259 \sa setBigIconSize() setIcon()
260*/ 260*/
261int AppLnk::bigIconSize() 261int AppLnk::bigIconSize()
262{ 262{
263 return bigSize; 263 return bigSize;
264} 264}
265 265
266 266
267/*! 267/*!
268 \fn QString AppLnk::name() const 268 \fn QString AppLnk::name() const
269 269
270 Returns the Name property. This is the user-visible name for the 270 Returns the Name property. This is the user-visible name for the
271 document or application, not the filename. 271 document or application, not the filename.
272 272
273 See \link #files-and-links Files and Links\endlink. 273 See \link #files-and-links Files and Links\endlink.
274 274
275 \sa setName() 275 \sa setName()
276*/ 276*/
277/*! 277/*!
278 \fn QString AppLnk::exec() const 278 \fn QString AppLnk::exec() const
279 279
280 Returns the Exec property. This is the name of the executable 280 Returns the Exec property. This is the name of the executable
281 program associated with the AppLnk. 281 program associated with the AppLnk.
282 282
283 \sa setExec() 283 \sa setExec()
284*/ 284*/
285/*! 285/*!
286 \fn QString AppLnk::rotation() const 286 \fn QString AppLnk::rotation() const
287 287
288 Returns the Rotation property. The value is 0, 90, 180 or 270 288 Returns the Rotation property. The value is 0, 90, 180 or 270
289 degrees. 289 degrees.
290*/ 290*/
291/*! 291/*!
292 \fn QString AppLnk::comment() const 292 \fn QString AppLnk::comment() const
293 293
294 Returns the Comment property. 294 Returns the Comment property.
295 295
296 \sa setComment() 296 \sa setComment()
297*/ 297*/
298/*! 298/*!
299 \fn QStringList AppLnk::mimeTypes() const 299 \fn QStringList AppLnk::mimeTypes() const
300 300
301 Returns the MimeTypes property. This is the list of MIME types 301 Returns the MimeTypes property. This is the list of MIME types
302 that the application can view or edit. 302 that the application can view or edit.
303*/ 303*/
304/*! 304/*!
305 \fn const QArray<int>& AppLnk::categories() const 305 \fn const QArray<int>& AppLnk::categories() const
306 306
307 Returns the Categories property. 307 Returns the Categories property.
308 308
309 See the CategoryWidget for more details. 309 See the CategoryWidget for more details.
310 310
311 \sa setCategories() 311 \sa setCategories()
312*/ 312*/
313 313
314const QArray<int>& AppLnk::categories() const 314const QArray<int>& AppLnk::categories() const
315{ 315{
316 d->ensureCatArray(); 316 d->ensureCatArray();
317 return d->mCat; 317 return d->mCat;
318} 318}
319 319
320/*! 320/*!
321 \fn int AppLnk::id() const 321 \fn int AppLnk::id() const
322 322
323 Returns the id of the AppLnk. If the AppLnk is not in an AppLnkSet, 323 Returns the id of the AppLnk. If the AppLnk is not in an AppLnkSet,
324 this value is 0, otherwise it is a value that is unique for the 324 this value is 0, otherwise it is a value that is unique for the
325 duration of the current process. 325 duration of the current process.
326 326
327 \sa AppLnkSet::find() 327 \sa AppLnkSet::find()
328*/ 328*/
329 329
330/*! 330/*!
331 \fn bool AppLnk::isValid() const 331 \fn bool AppLnk::isValid() const
332 332
333 Returns TRUE if this AppLnk is valid; otherwise returns FALSE. 333 Returns TRUE if this AppLnk is valid; otherwise returns FALSE.
334*/ 334*/
335 335
336/*! 336/*!
337 Creates an invalid AppLnk. 337 Creates an invalid AppLnk.
338 338
339 \sa isValid() 339 \sa isValid()
340*/ 340*/
341AppLnk::AppLnk() 341AppLnk::AppLnk()
342{ 342{
343 mId = 0; 343 mId = 0;
344 d = new AppLnkPrivate(); 344 d = new AppLnkPrivate();
345} 345}
346 346
347/*! 347/*!
348 Loads \a file (e.g. \e app.desktop) as an AppLnk. 348 Loads \a file (e.g. \e app.desktop) as an AppLnk.
349 349
350 \sa writeLink() 350 \sa writeLink()
351*/ 351*/
352AppLnk::AppLnk( const QString &file ) 352AppLnk::AppLnk( const QString &file )
353{ 353{
354 QStringList sl; 354 QStringList sl;
355 d = new AppLnkPrivate(); 355 d = new AppLnkPrivate();
356 if ( !file.isNull() ) { 356 if ( !file.isNull() ) {
357 Config config( file, Config::File ); 357 Config config( file, Config::File );
358 358
359 if ( config.isValid() ) { 359 if ( config.isValid() ) {
360 config.setGroup( "Desktop Entry" ); 360 config.setGroup( "Desktop Entry" );
361 361
362 mName = config.readEntry( "Name", file ); 362 mName = config.readEntry( "Name", file );
363 mExec = config.readEntry( "Exec" ); 363 mExec = config.readEntry( "Exec" );
364 mType = config.readEntry( "Type", QString::null ); 364 mType = config.readEntry( "Type", QString::null );
365 mIconFile = config.readEntry( "Icon", QString::null ); 365 mIconFile = config.readEntry( "Icon", QString::null );
366 mRotation = config.readEntry( "Rotation", "" ); 366 mRotation = config.readEntry( "Rotation", "" );
367 mComment = config.readEntry( "Comment", QString::null ); 367 mComment = config.readEntry( "Comment", QString::null );
368 // MIME types are case-insensitive. 368 // MIME types are case-insensitive.
369 mMimeTypes = config.readListEntry( "MimeType", ';' ); 369 mMimeTypes = config.readListEntry( "MimeType", ';' );
370 for (QStringList::Iterator it=mMimeTypes.begin(); it!=mMimeTypes.end(); ++it) 370 for (QStringList::Iterator it=mMimeTypes.begin(); it!=mMimeTypes.end(); ++it)
371 *it = (*it).lower(); 371 *it = (*it).lower();
372 mMimeTypeIcons = config.readListEntry( "MimeTypeIcons", ';' ); 372 mMimeTypeIcons = config.readListEntry( "MimeTypeIcons", ';' );
373 mLinkFile = file; 373 mLinkFile = file;
374 mFile = config.readEntry("File", QString::null); 374 mFile = config.readEntry("File", QString::null);
375 if ( mFile[0] != '/' ) { 375 if ( !mExec. isEmpty ( )) {
376 mFile = QString::null;
377 }
378 else if ( mFile[0] != '/' ) {
376 int slash = file.findRev('/'); 379 int slash = file.findRev('/');
377 if ( slash >= 0 ) { 380 if ( slash >= 0 ) {
378 mFile = file.left(slash) + '/' + mFile; 381 mFile = file.left(slash) + '/' + mFile;
379 } 382 }
380 } 383 }
381 d->mCatList = config.readListEntry("Categories", ';'); 384 d->mCatList = config.readListEntry("Categories", ';');
382 if ( d->mCatList[0].toInt() < -1 ) { 385 if ( d->mCatList[0].toInt() < -1 ) {
383 // numeric cats in file! convert to text 386 // numeric cats in file! convert to text
384 Categories cat( 0 ); 387 Categories cat( 0 );
385 cat.load( categoryFileName() ); 388 cat.load( categoryFileName() );
386 d->mCat.resize( d->mCatList.count() ); 389 d->mCat.resize( d->mCatList.count() );
387 int i; 390 int i;
388 QStringList::ConstIterator it; 391 QStringList::ConstIterator it;
389 for ( i = 0, it = d->mCatList.begin(); it != d->mCatList.end(); 392 for ( i = 0, it = d->mCatList.begin(); it != d->mCatList.end();
390 ++it, i++ ) { 393 ++it, i++ ) {
391 bool number; 394 bool number;
392 int id = (*it).toInt( &number ); 395 int id = (*it).toInt( &number );
393 if ( !number ) { 396 if ( !number ) {
394 // convert from text 397 // convert from text
395 id = cat.id( "Document View", *it ); 398 id = cat.id( "Document View", *it );
396 if ( id == 0 ) 399 if ( id == 0 )
397 id = cat.addCategory( "Document View", *it ); 400 id = cat.addCategory( "Document View", *it );
398 } 401 }
399 d->mCat[i] = id; 402 d->mCat[i] = id;
400 } 403 }
401 d->updateCatListFromArray(); 404 d->updateCatListFromArray();
402 } 405 }
403 } 406 }
404 } 407 }
405 mId = 0; 408 mId = 0;
406} 409}
407 410
408AppLnk& AppLnk::operator=(const AppLnk &copy) 411AppLnk& AppLnk::operator=(const AppLnk &copy)
409{ 412{
410 if ( mId ) 413 if ( mId )
411 qWarning("Deleting AppLnk that is in an AppLnkSet"); 414 qWarning("Deleting AppLnk that is in an AppLnkSet");
412 if ( d ) 415 if ( d )
413 delete d; 416 delete d;
414 417
415 418
416 mName = copy.mName; 419 mName = copy.mName;
417 420
418 /* remove for Qtopia 3.0 -zecke */ 421 /* remove for Qtopia 3.0 -zecke */
419 mPixmap = copy.mPixmap; 422 mPixmap = copy.mPixmap;
420 mBigPixmap = copy.mBigPixmap; 423 mBigPixmap = copy.mBigPixmap;
421 424
422 mExec = copy.mExec; 425 mExec = copy.mExec;
423 mType = copy.mType; 426 mType = copy.mType;
424 mRotation = copy.mRotation; 427 mRotation = copy.mRotation;
425 mComment = copy.mComment; 428 mComment = copy.mComment;
426 mFile = copy.mFile; 429 mFile = copy.mFile;
427 mLinkFile = copy.mLinkFile; 430 mLinkFile = copy.mLinkFile;
428 mIconFile = copy.mIconFile; 431 mIconFile = copy.mIconFile;
429 mMimeTypes = copy.mMimeTypes; 432 mMimeTypes = copy.mMimeTypes;
430 mMimeTypeIcons = copy.mMimeTypeIcons; 433 mMimeTypeIcons = copy.mMimeTypeIcons;
431 mId = 0; 434 mId = 0;
432 d = new AppLnkPrivate(); 435 d = new AppLnkPrivate();
433 d->mCat = copy.d->mCat; 436 d->mCat = copy.d->mCat;
434 d->mCatList = copy.d->mCatList; 437 d->mCatList = copy.d->mCatList;
435 d->mPixmaps = copy.d->mPixmaps; 438 d->mPixmaps = copy.d->mPixmaps;
436 439
437 return *this; 440 return *this;
438} 441}
439/*! 442/*!
440 protected internally to share code 443 protected internally to share code
441 should I document that at all? 444 should I document that at all?
442 I don't know the TT style for that 445 I don't know the TT style for that
443*/ 446*/
444const QPixmap& AppLnk::pixmap( int pos, int size ) const { 447const QPixmap& AppLnk::pixmap( int pos, int size ) const {
445 if ( d->mPixmaps[pos].isNull() ) { 448 if ( d->mPixmaps[pos].isNull() ) {
446 AppLnk* that = (AppLnk*)this; 449 AppLnk* that = (AppLnk*)this;
447 if ( mIconFile.isEmpty() ) { 450 if ( mIconFile.isEmpty() ) {
448 MimeType mt(type()); 451 MimeType mt(type());
449 that->d->mPixmaps[pos] = mt.pixmap(); 452 that->d->mPixmaps[pos] = mt.pixmap();
450 if ( that->d->mPixmaps[pos].isNull() ) 453 if ( that->d->mPixmaps[pos].isNull() )
451 that->d->mPixmaps[pos].convertFromImage( 454 that->d->mPixmaps[pos].convertFromImage(
452 Resource::loadImage("UnknownDocument") 455 Resource::loadImage("UnknownDocument")
453 .smoothScale( size, size ) ); 456 .smoothScale( size, size ) );
454 return that->d->mPixmaps[pos]; 457 return that->d->mPixmaps[pos];
455 } 458 }
456 QImage unscaledIcon = Resource::loadImage( that->mIconFile ); 459 QImage unscaledIcon = Resource::loadImage( that->mIconFile );
457 if ( unscaledIcon.isNull() ) { 460 if ( unscaledIcon.isNull() ) {
458 qDebug( "Cannot find icon: %s", that->mIconFile.latin1() ); 461 qDebug( "Cannot find icon: %s", that->mIconFile.latin1() );
459 that->d->mPixmaps[pos].convertFromImage( 462 that->d->mPixmaps[pos].convertFromImage(
460 Resource::loadImage("UnknownDocument") 463 Resource::loadImage("UnknownDocument")
461 .smoothScale( size, size ) ); 464 .smoothScale( size, size ) );
462 } else { 465 } else {
463 that->d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); 466 that->d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) );
464 that->d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); 467 that->d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) );
465 } 468 }
466 return that->d->mPixmaps[pos]; 469 return that->d->mPixmaps[pos];
467 } 470 }
468 return d->mPixmaps[pos]; 471 return d->mPixmaps[pos];
469} 472}
470 473
471/*! 474/*!
472 Returns a small pixmap associated with the application. 475 Returns a small pixmap associated with the application.
473 476
474 \sa bigPixmap() setIcon() 477 \sa bigPixmap() setIcon()
475*/ 478*/
476const QPixmap& AppLnk::pixmap() const 479const QPixmap& AppLnk::pixmap() const
477{ 480{
478 if ( d->mPixmaps[0].isNull() ) { 481 if ( d->mPixmaps[0].isNull() ) {
479 return pixmap(AppLnkPrivate::Normal, smallSize ); 482 return pixmap(AppLnkPrivate::Normal, smallSize );
480 } 483 }
481 return d->mPixmaps[0]; 484 return d->mPixmaps[0];
482} 485}
483 486
484/*! 487/*!
485 Returns a large pixmap associated with the application. 488 Returns a large pixmap associated with the application.
486 489
487 \sa pixmap() setIcon() 490 \sa pixmap() setIcon()
488*/ 491*/
489const QPixmap& AppLnk::bigPixmap() const 492const QPixmap& AppLnk::bigPixmap() const
490{ 493{
491 if ( d->mPixmaps[1].isNull() ) { 494 if ( d->mPixmaps[1].isNull() ) {
492 return pixmap( AppLnkPrivate::Big, bigSize ); 495 return pixmap( AppLnkPrivate::Big, bigSize );
493 } 496 }
494 return d->mPixmaps[1]; 497 return d->mPixmaps[1];
495} 498}
496 499
497/*! 500/*!
498 Returns the type of the AppLnk. For applications, games and 501 Returns the type of the AppLnk. For applications, games and
499 settings the type is \c Application; for documents the type is the 502 settings the type is \c Application; for documents the type is the
500 document's MIME type. 503 document's MIME type.
501*/ 504*/
502QString AppLnk::type() const 505QString AppLnk::type() const
503{ 506{
504 if ( mType.isNull() ) { 507 if ( mType.isNull() ) {
505 AppLnk* that = (AppLnk*)this; 508 AppLnk* that = (AppLnk*)this;
506 QString f = file(); 509 QString f = file();
507 if ( !f.isNull() ) { 510 if ( !f.isNull() ) {
508 MimeType mt(f); 511 MimeType mt(f);
509 that->mType = mt.id(); 512 that->mType = mt.id();
510 return that->mType; 513 return that->mType;
511 } 514 }
512 } 515 }
513 return mType; 516 return mType;
514} 517}
515 518
516/*! 519/*!
517 Returns the file associated with the AppLnk. 520 Returns the file associated with the AppLnk.
518 521
519 \sa exec() name() 522 \sa exec() name()
520*/ 523*/
521QString AppLnk::file() const 524QString AppLnk::file() const
522{ 525{
523 if ( mFile.isNull() ) { 526 if ( mExec.isEmpty ( ) && mFile.isNull() ) {
524 AppLnk* that = (AppLnk*)this; 527 AppLnk* that = (AppLnk*)this;
525 QString ext = MimeType(mType).extension(); 528 QString ext = MimeType(mType).extension();
526 if ( !ext.isEmpty() ) 529 if ( !ext.isEmpty() )
527 ext = "." + ext; 530 ext = "." + ext;
528 if ( !mLinkFile.isEmpty() ) { 531 if ( !mLinkFile.isEmpty() ) {
529 that->mFile = 532 that->mFile =
530 mLinkFile.right(8)==".desktop" // 8 = strlen(".desktop") 533 mLinkFile.right(8)==".desktop" // 8 = strlen(".desktop")
531 ? mLinkFile.left(mLinkFile.length()-8) : mLinkFile; 534 ? mLinkFile.left(mLinkFile.length()-8) : mLinkFile;
535 qDebug("mFile now == %s", mFile.latin1());
532 } else if ( mType.contains('/') ) { 536 } else if ( mType.contains('/') ) {
533 that->mFile = 537 that->mFile =
534 QString(getenv("HOME"))+"/Documents/"+mType+"/"+safeFileName(that->mName); 538 QString(getenv("HOME"))+"/Documents/"+mType+"/"+safeFileName(that->mName);
535 /* 539 /*
536 * A file with the same name or a .desktop file already exists 540 * A file with the same name or a .desktop file already exists
537 */ 541 */
538 if ( QFile::exists(that->mFile+ext) || QFile::exists(that->mFile+".desktop") ) { 542 if ( QFile::exists(that->mFile+ext) || QFile::exists(that->mFile+".desktop") ) {
539 int n=1; 543 int n=1;
540 QString nn; 544 QString nn;
541 while (QFile::exists((nn=(that->mFile+"_"+QString::number(n)))+ext) 545 while (QFile::exists((nn=(that->mFile+"_"+QString::number(n)))+ext)
542 || QFile::exists(nn+".desktop")) 546 || QFile::exists(nn+".desktop"))
543 n++; 547 n++;
544 that->mFile = nn; 548 that->mFile = nn;
545 } 549 }
546 that->mLinkFile = that->mFile+".desktop"; 550 that->mLinkFile = that->mFile+".desktop";
547 that->mFile += ext; 551 that->mFile += ext;
548 } 552 }
549 prepareDirectories(that->mFile); 553 prepareDirectories(that->mFile);
550 if ( !that->mFile.isEmpty() ) { 554 if ( !that->mFile.isEmpty() ) {
551 QFile f(that->mFile); 555 QFile f(that->mFile);
552 if ( !f.open(IO_WriteOnly) ) 556 if ( !f.open(IO_WriteOnly) )
553 that->mFile = QString::null; 557 that->mFile = QString::null;
554 return that->mFile; 558 return that->mFile;
555 } 559 }
556 } 560 }
557 return mFile; 561 return mFile;
558} 562}
559 563
560/*! 564/*!
561 Returns the desktop file corresponding to this AppLnk. 565 Returns the desktop file corresponding to this AppLnk.
562 566
563 \sa file() exec() name() 567 \sa file() exec() name()
564*/ 568*/
565QString AppLnk::linkFile() const 569QString AppLnk::linkFile() const
566{ 570{
567 if ( mLinkFile.isNull() ) { 571 if ( mLinkFile.isNull() ) {
568 AppLnk* that = (AppLnk*)this; 572 AppLnk* that = (AppLnk*)this;
569 if ( type().contains('/') ) { 573 if ( type().contains('/') ) {
570 StorageInfo storage; 574 StorageInfo storage;
571 const FileSystem *fs = storage.fileSystemOf( that->mFile ); 575 const FileSystem *fs = storage.fileSystemOf( that->mFile );
572 /* tmpfs + and ramfs are available too but not removable 576 /* tmpfs + and ramfs are available too but not removable
573 * either we fix storage or add this 577 * either we fix storage or add this
574 */ 578 */
575 if ( fs && ( fs->isRemovable() || fs->disk() == "/dev/mtdblock6" || fs->disk() == "tmpfs") ) { 579 if ( fs && ( fs->isRemovable() || fs->disk() == "/dev/mtdblock6" || fs->disk() == "tmpfs") ) {
576 that->mLinkFile = fs->path(); 580 that->mLinkFile = fs->path();
577 } else 581 } else
578 that->mLinkFile = getenv( "HOME" ); 582 that->mLinkFile = getenv( "HOME" );
579 that->mLinkFile += "/Documents/"+type()+"/"+safeFileName(that->mName); 583 that->mLinkFile += "/Documents/"+type()+"/"+safeFileName(that->mName);
580 584
581 /* the desktop file exists make sure we don't point to the same file */ 585 /* the desktop file exists make sure we don't point to the same file */
582 if ( QFile::exists(that->mLinkFile+".desktop") ) { 586 if ( QFile::exists(that->mLinkFile+".desktop") ) {
583 AppLnk lnk( that->mLinkFile + ".desktop" ); 587 AppLnk lnk( that->mLinkFile + ".desktop" );
584 588
585 /* the linked is different */ 589 /* the linked is different */
586 if(that->file() != lnk.file() ) { 590 if(that->file() != lnk.file() ) {
587 int n = 1; 591 int n = 1;
588 QString nn; 592 QString nn;
589 while (QFile::exists((nn=that->mLinkFile+"_"+QString::number(n))+".desktop")) { 593 while (QFile::exists((nn=that->mLinkFile+"_"+QString::number(n))+".desktop")) {
590 n++; 594 n++;
591 /* just to be sure */ 595 /* just to be sure */
592 AppLnk lnk(nn ); 596 AppLnk lnk(nn );
593 if (lnk.file() == that->file() ) 597 if (lnk.file() == that->file() )
594 break; 598 break;
595 } 599 }
596 that->mLinkFile = nn; 600 that->mLinkFile = nn;
597 } 601 }
598 } 602 }
599 that->mLinkFile += ".desktop"; 603 that->mLinkFile += ".desktop";
600 storeLink(); 604 storeLink();
601 } 605 }
602 return that->mLinkFile; 606 return that->mLinkFile;
603 } 607 }
604 return mLinkFile; 608 return mLinkFile;
605} 609}
606 610
607/*! 611/*!
608 Copies \a copy. 612 Copies \a copy.
609*/ 613*/
610AppLnk::AppLnk( const AppLnk &copy ) 614AppLnk::AppLnk( const AppLnk &copy )
611{ 615{
612 mName = copy.mName; 616 mName = copy.mName;
613 mPixmap = copy.mPixmap; 617 mPixmap = copy.mPixmap;
614 mBigPixmap = copy.mBigPixmap; 618 mBigPixmap = copy.mBigPixmap;
615 mExec = copy.mExec; 619 mExec = copy.mExec;
616 mType = copy.mType; 620 mType = copy.mType;
617 mRotation = copy.mRotation; 621 mRotation = copy.mRotation;
618 mComment = copy.mComment; 622 mComment = copy.mComment;
619 mFile = copy.mFile; 623 mFile = copy.mFile;
620 mLinkFile = copy.mLinkFile; 624 mLinkFile = copy.mLinkFile;
621 mIconFile = copy.mIconFile; 625 mIconFile = copy.mIconFile;
622 mMimeTypes = copy.mMimeTypes; 626 mMimeTypes = copy.mMimeTypes;
623 mMimeTypeIcons = copy.mMimeTypeIcons; 627 mMimeTypeIcons = copy.mMimeTypeIcons;
624 mId = 0; 628 mId = 0;
625 d = new AppLnkPrivate(); 629 d = new AppLnkPrivate();
626 d->mCat = copy.d->mCat; 630 d->mCat = copy.d->mCat;
627 d->mCatList = copy.d->mCatList; 631 d->mCatList = copy.d->mCatList;
628 d->mPixmaps = copy.d->mPixmaps; 632 d->mPixmaps = copy.d->mPixmaps;
629} 633}
630 634
631/*! 635/*!
632 Destroys the AppLnk. Note that if the AppLnk is currently a member 636 Destroys the AppLnk. Note that if the AppLnk is currently a member
633 of an AppLnkSet, this will produce a run-time warning. 637 of an AppLnkSet, this will produce a run-time warning.
634 638
635 \sa AppLnkSet::add() AppLnkSet::remove() 639 \sa AppLnkSet::add() AppLnkSet::remove()
636*/ 640*/
637AppLnk::~AppLnk() 641AppLnk::~AppLnk()
638{ 642{
639 if ( mId ) 643 if ( mId )
640 qWarning("Deleting AppLnk that is in an AppLnkSet"); 644 qWarning("Deleting AppLnk that is in an AppLnkSet");
641 if ( d ) 645 if ( d )
642 delete d; 646 delete d;
643} 647}
644 648
645/*! 649/*!
646 \overload 650 \overload
647 Executes the application associated with this AppLnk. 651 Executes the application associated with this AppLnk.
648 652
649 \sa exec() 653 \sa exec()
650*/ 654*/
651void AppLnk::execute() const 655void AppLnk::execute() const
652{ 656{
653 execute(QStringList()); 657 execute(QStringList());
654} 658}
655 659
656/*! 660/*!
657 Executes the application associated with this AppLnk, with 661 Executes the application associated with this AppLnk, with
658 \a args as arguments. 662 \a args as arguments.
659 663
660 \sa exec() 664 \sa exec()
661*/ 665*/
662void AppLnk::execute(const QStringList& args) const 666void AppLnk::execute(const QStringList& args) const
663{ 667{
664#ifdef Q_WS_QWS 668#ifdef Q_WS_QWS
665 if ( !mRotation.isEmpty() ) { 669 if ( !mRotation.isEmpty() ) {
666 // ######## this will only work in the server 670 // ######## this will only work in the server
667 int rot = QPEApplication::defaultRotation(); 671 int rot = QPEApplication::defaultRotation();
668 rot = (rot+mRotation.toInt())%360; 672 rot = (rot+mRotation.toInt())%360;
669 QCString old = getenv("QWS_DISPLAY"); 673 QCString old = getenv("QWS_DISPLAY");
670 setenv("QWS_DISPLAY", QString("Transformed:Rot%1:0").arg(rot), 1); 674 setenv("QWS_DISPLAY", QString("Transformed:Rot%1:0").arg(rot), 1);
671 invoke(args); 675 invoke(args);
672 setenv("QWS_DISPLAY", old.data(), 1); 676 setenv("QWS_DISPLAY", old.data(), 1);
673 } else 677 } else
674#endif 678#endif
675 invoke(args); 679 invoke(args);
676} 680}
677 681
678/*! 682/*!
679 Invokes the application associated with this AppLnk, with 683 Invokes the application associated with this AppLnk, with
680 \a args as arguments. Rotation is not taken into account by 684 \a args as arguments. Rotation is not taken into account by
681 this function, so you should not call it directly. 685 this function, so you should not call it directly.
682 686
683 \sa execute() 687 \sa execute()
684*/ 688*/
685void AppLnk::invoke(const QStringList& args) const 689void AppLnk::invoke(const QStringList& args) const
686{ 690{
687 Global::execute( exec(), args[0] ); 691 Global::execute( exec(), args[0] );
688} 692}
689 693
690/*! 694/*!
691 Sets the Exec property to \a exec. 695 Sets the Exec property to \a exec.
692 696
693 \sa exec() name() 697 \sa exec() name()
694*/ 698*/
695void AppLnk::setExec( const QString& exec ) 699void AppLnk::setExec( const QString& exec )
696{ 700{
697 mExec = exec; 701 mExec = exec;
698} 702}
699 703
704#if 0 // this was inlined for better BC
705/*!
706 Sets the Rotation property to \a rot.
707
708 \sa rotation()
709*/
710void AppLnk::setRotation ( const QString &rot )
711{
712 mRotation = rot;
713}
714#endif
715
700/*! 716/*!
701 Sets the Name property to \a docname. 717 Sets the Name property to \a docname.
702 718
703 \sa name() 719 \sa name()
704*/ 720*/
705void AppLnk::setName( const QString& docname ) 721void AppLnk::setName( const QString& docname )
706{ 722{
707 mName = docname; 723 mName = docname;
708} 724}
709 725
710/*! 726/*!
711 Sets the File property to \a filename. 727 Sets the File property to \a filename.
712 728
713 \sa file() name() 729 \sa file() name()
714*/ 730*/
715void AppLnk::setFile( const QString& filename ) 731void AppLnk::setFile( const QString& filename )
716{ 732{
717 mFile = filename; 733 mFile = filename;
718} 734}
719 735
720/*! 736/*!
721 Sets the LinkFile property to \a filename. 737 Sets the LinkFile property to \a filename.
722 738
723 \sa linkFile() 739 \sa linkFile()
724*/ 740*/
725void AppLnk::setLinkFile( const QString& filename ) 741void AppLnk::setLinkFile( const QString& filename )
726{ 742{
727 mLinkFile = filename; 743 mLinkFile = filename;
728} 744}
729 745
730/*! 746/*!
731 Sets the Comment property to \a comment. 747 Sets the Comment property to \a comment.
732 748
733 This text is displayed in the 'Details Dialog', for example if the 749 This text is displayed in the 'Details Dialog', for example if the
734 user uses the 'press-and-hold' gesture. 750 user uses the 'press-and-hold' gesture.
735 751
736 \sa comment() 752 \sa comment()
737*/ 753*/
738void AppLnk::setComment( const QString& comment ) 754void AppLnk::setComment( const QString& comment )
739{ 755{
740 mComment = comment; 756 mComment = comment;
741} 757}
742 758
743/*! 759/*!
744 Sets the Type property to \a type. 760 Sets the Type property to \a type.
745 761
746 For applications, games and settings the type should be \c 762 For applications, games and settings the type should be \c
747 Application; for documents the type should be the document's MIME 763 Application; for documents the type should be the document's MIME
748 type. 764 type.
749 765
750 \sa type() 766 \sa type()
751*/ 767*/
752void AppLnk::setType( const QString& type ) 768void AppLnk::setType( const QString& type )
753{ 769{
754 mType = type; 770 mType = type;
755} 771}
756 772
757/*! 773/*!
758 \fn QString AppLnk::icon() const 774 \fn QString AppLnk::icon() const
759 775
760 Returns the Icon property. 776 Returns the Icon property.
761 777
762 \sa setIcon() 778 \sa setIcon()
763*/ 779*/
764 780
765/*! 781/*!
766 Sets the Icon property to \a iconname. This is the filename from 782 Sets the Icon property to \a iconname. This is the filename from
767 which the pixmap() and bigPixmap() are obtained. 783 which the pixmap() and bigPixmap() are obtained.
768 784
769 \sa icon() setSmallIconSize() setBigIconSize() 785 \sa icon() setSmallIconSize() setBigIconSize()
770*/ 786*/
771void AppLnk::setIcon( const QString& iconname ) 787void AppLnk::setIcon( const QString& iconname )
772{ 788{
773 mIconFile = iconname; 789 mIconFile = iconname;
774 QImage unscaledIcon = Resource::loadImage( mIconFile ); 790 QImage unscaledIcon = Resource::loadImage( mIconFile );
775 d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); 791 d->mPixmaps[0].convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) );
776 d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); 792 d->mPixmaps[1].convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) );
777} 793}
778 794
779/*! 795/*!
780 Sets the Categories property to \a c. 796 Sets the Categories property to \a c.
781 797
782 See the CategoryWidget for more details. 798 See the CategoryWidget for more details.
783 799
784 \sa categories() 800 \sa categories()
785*/ 801*/
786void AppLnk::setCategories( const QArray<int>& c ) 802void AppLnk::setCategories( const QArray<int>& c )
787{ 803{
788 d->mCat = c; 804 d->mCat = c;
789 d->updateCatListFromArray(); 805 d->updateCatListFromArray();
790} 806}
791 807
792/*! 808/*!
793 \fn QStringList AppLnk::mimeTypeIcons() const 809 \fn QStringList AppLnk::mimeTypeIcons() const
794 810
795 Returns the MimeTypeIcons property of the AppLnk. 811 Returns the MimeTypeIcons property of the AppLnk.
796*/ 812*/
797 813
798/*! 814/*!
799 Attempts to ensure that the link file for this AppLnk exists, 815 Attempts to ensure that the link file for this AppLnk exists,
800 including creating any required directories. Returns TRUE if 816 including creating any required directories. Returns TRUE if
801 successful; otherwise returns FALSE. 817 successful; otherwise returns FALSE.
802 818
803 You should not need to use this function. 819 You should not need to use this function.
804*/ 820*/
805bool AppLnk::ensureLinkExists() const 821bool AppLnk::ensureLinkExists() const
806{ 822{
807 QString lf = linkFile(); 823 QString lf = linkFile();
808 return prepareDirectories(lf); 824 return prepareDirectories(lf);
809} 825}
810 826
811/*! 827/*!
812 Commits the AppLnk to disk. Returns TRUE if the operation succeeded; 828 Commits the AppLnk to disk. Returns TRUE if the operation succeeded;
813 otherwise returns FALSE. 829 otherwise returns FALSE.
814 830
815 In addition, the "linkChanged(QString)" message is sent to the 831 In addition, the "linkChanged(QString)" message is sent to the
816 "QPE/System" \link qcop.html QCop\endlink channel. 832 "QPE/System" \link qcop.html QCop\endlink channel.
817*/ 833*/
818bool AppLnk::writeLink() const 834bool AppLnk::writeLink() const
819{ 835{
820 // Only re-writes settable parts 836 // Only re-writes settable parts
821 QString lf = linkFile(); 837 QString lf = linkFile();
822 if ( !ensureLinkExists() ) 838 if ( !ensureLinkExists() )
823 return FALSE; 839 return FALSE;
824 storeLink(); 840 storeLink();
825 return TRUE; 841 return TRUE;
826} 842}
827 843
828/*! 844/*!
829 \internal 845 \internal
830*/ 846*/
831void AppLnk::storeLink() const 847void AppLnk::storeLink() const
832{ 848{
833 Config config( mLinkFile, Config::File ); 849 Config config( mLinkFile, Config::File );
834 config.setGroup("Desktop Entry"); 850 config.setGroup("Desktop Entry");
835 config.writeEntry("Name",mName); 851 config.writeEntry("Name",mName);
836 if ( !mIconFile.isNull() ) config.writeEntry("Icon",mIconFile); 852 if ( !mIconFile.isNull() ) config.writeEntry("Icon",mIconFile);
837 config.writeEntry("Type",type()); 853 config.writeEntry("Type",type());
854 if(!rotation().isEmpty())
855 config.writeEntry("Rotation",rotation());
856 else
857 config.removeEntry("Rotation");
838 if ( !mComment.isNull() ) config.writeEntry("Comment",mComment); 858 if ( !mComment.isNull() ) config.writeEntry("Comment",mComment);
839 QString f = file(); 859 QString f = file();
840 int i = 0; 860 int i = 0;
841 while ( i < (int)f.length() && i < (int)mLinkFile.length() && f[i] == mLinkFile[i] ) 861 while ( i < (int)f.length() && i < (int)mLinkFile.length() && f[i] == mLinkFile[i] )
842 i++; 862 i++;
843 while ( i && f[i] != '/' ) 863 while ( i && f[i] != '/' )
844 i--; 864 i--;
845 // simple case where in the same directory 865 // simple case where in the same directory
846 if ( mLinkFile.find( '/', i + 1 ) < 0 ) 866 if ( mLinkFile.find( '/', i + 1 ) < 0 )
847 f = f.mid(i+1); 867 f = f.mid(i+1);
848 // ### could do relative ie ../../otherDocs/file.doc 868 // ### could do relative ie ../../otherDocs/file.doc
849 config.writeEntry("File",f); 869 config.writeEntry("File",f);
850 config.writeEntry( "Categories", d->mCatList, ';' ); 870 config.writeEntry( "Categories", d->mCatList, ';' );
851 871
852#ifndef QT_NO_COP 872#ifndef QT_NO_COP
853 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 873 QCopEnvelope e("QPE/System", "linkChanged(QString)");
854 e << mLinkFile; 874 e << mLinkFile;
855#endif 875#endif
856} 876}
857 877
858/*! 878/*!
859 Sets the property named \a key to \a value. 879 Sets the property named \a key to \a value.
860 880
861 \sa property() 881 \sa property()
862*/ 882*/
863void AppLnk::setProperty(const QString& key, const QString& value) 883void AppLnk::setProperty(const QString& key, const QString& value)
864{ 884{
865 if ( ensureLinkExists() ) { 885 if ( ensureLinkExists() ) {
866 Config cfg(linkFile(), Config::File); 886 Config cfg(linkFile(), Config::File);
867 cfg.writeEntry(key,value); 887 cfg.writeEntry(key,value);
868 } 888 }
869} 889}
870 890
871/*! 891/*!
872 Returns the property named \a key. 892 Returns the property named \a key.
873 893
874 \sa setProperty() 894 \sa setProperty()
875*/ 895*/
876QString AppLnk::property(const QString& key) const 896QString AppLnk::property(const QString& key) const
877{ 897{
878 QString lf = linkFile(); 898 QString lf = linkFile();
879 if ( !QFile::exists(lf) ) 899 if ( !QFile::exists(lf) )
880 return QString::null; 900 return QString::null;
881 Config cfg(lf, Config::File); 901 Config cfg(lf, Config::File);
882 return cfg.readEntry(key); 902 return cfg.readEntry(key);
883} 903}
884 904
885bool AppLnk::isPreloaded() const { 905bool AppLnk::isPreloaded() const {
886 // Preload information is stored in the Launcher config in v1.5. 906 // Preload information is stored in the Launcher config in v1.5.
887 Config cfg("Launcher"); 907 Config cfg("Launcher");
888 cfg.setGroup("Preload"); 908 cfg.setGroup("Preload");
889 QStringList apps = cfg.readListEntry("Apps",','); 909 QStringList apps = cfg.readListEntry("Apps",',');
890 if (apps.contains(exec())) 910 if (apps.contains(exec()))
891 return true; 911 return true;
892 return false; 912 return false;
893} 913}
894 914
895void AppLnk::setPreloaded(bool yesNo) { 915void AppLnk::setPreloaded(bool yesNo) {
896 // Preload information is stored in the Launcher config in v1.5. 916 // Preload information is stored in the Launcher config in v1.5.
897 Config cfg("Launcher"); 917 Config cfg("Launcher");
898 cfg.setGroup("Preload"); 918 cfg.setGroup("Preload");
899 QStringList apps = cfg.readListEntry("Apps", ','); 919 QStringList apps = cfg.readListEntry("Apps", ',');
900 if (apps.contains(exec()) && !yesNo) 920 if (apps.contains(exec()) && !yesNo)
901 apps.remove(exec()); 921 apps.remove(exec());
902 else if (yesNo && !apps.contains(exec())) 922 else if (yesNo && !apps.contains(exec()))
903 apps.append(exec()); 923 apps.append(exec());
904 cfg.writeEntry("Apps", apps, ','); 924 cfg.writeEntry("Apps", apps, ',');
905} 925}
906 926
907 927
908/*! 928/*!
909 Deletes both the linkFile() and the file() associated with this AppLnk. 929 Deletes both the linkFile() and the file() associated with this AppLnk.
910 930
911 \sa removeLinkFile() 931 \sa removeLinkFile()
912*/ 932*/
913void AppLnk::removeFiles() 933void AppLnk::removeFiles()
914{ 934{
915 bool valid = isValid(); 935 bool valid = isValid();
916 if ( !valid || !linkFileKnown() || QFile::remove(linkFile()) ) { 936 if ( !valid || !linkFileKnown() || QFile::remove(linkFile()) ) {
917 if ( QFile::remove(file()) ) { 937 if ( QFile::remove(file()) ) {
918#ifndef QT_NO_COP 938#ifndef QT_NO_COP
919 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 939 QCopEnvelope e("QPE/System", "linkChanged(QString)");
920 if ( linkFileKnown() ) 940 if ( linkFileKnown() )
921 e << linkFile(); 941 e << linkFile();
922 else 942 else
923 e << file(); 943 e << file();
924#endif 944#endif
925 } else if ( valid ) { 945 } else if ( valid ) {
926 // restore link 946 // restore link
927 writeLink(); 947 writeLink();
928 } 948 }
929 } 949 }
930} 950}
931 951
932/*! 952/*!
933 Deletes the linkFile(), leaving any file() untouched. 953 Deletes the linkFile(), leaving any file() untouched.
934 954
935 \sa removeFiles() 955 \sa removeFiles()
936*/ 956*/
937void AppLnk::removeLinkFile() 957void AppLnk::removeLinkFile()
938{ 958{
939 if ( isValid() && linkFileKnown() && QFile::remove(linkFile()) ) { 959 if ( isValid() && linkFileKnown() && QFile::remove(linkFile()) ) {
940#ifndef QT_NO_COP 960#ifndef QT_NO_COP
941 QCopEnvelope e("QPE/System", "linkChanged(QString)"); 961 QCopEnvelope e("QPE/System", "linkChanged(QString)");
942 e << linkFile(); 962 e << linkFile();
943#endif 963#endif
944 } 964 }
945} 965}
946 966
947class AppLnkSetPrivate { 967class AppLnkSetPrivate {
948public: 968public:
949 AppLnkSetPrivate() 969 AppLnkSetPrivate()
950 { 970 {
951 typPix.setAutoDelete(TRUE); 971 typPix.setAutoDelete(TRUE);
952 typPixBig.setAutoDelete(TRUE); 972 typPixBig.setAutoDelete(TRUE);
953 typName.setAutoDelete(TRUE); 973 typName.setAutoDelete(TRUE);
954 } 974 }
955 975
956 QDict<QPixmap> typPix; 976 QDict<QPixmap> typPix;
957 QDict<QPixmap> typPixBig; 977 QDict<QPixmap> typPixBig;
958 QDict<QString> typName; 978 QDict<QString> typName;
959}; 979};
960 980
961/*! 981/*!
962 \class AppLnkSet applnk.h 982 \class AppLnkSet applnk.h
963 \brief The AppLnkSet class is a set of AppLnk objects. 983 \brief The AppLnkSet class is a set of AppLnk objects.
964*/ 984*/
965 985
966/*! 986/*!
967 \fn QStringList AppLnkSet::types() const 987 \fn QStringList AppLnkSet::types() const
968 988
969 Returns the list of \link applnk.html#Types types\endlink in the set. 989 Returns the list of \link applnk.html#Types types\endlink in the set.
970 990
971 For applications, games and settings the type is \c Application; 991 For applications, games and settings the type is \c Application;
972 for documents the type is the document's MIME type. 992 for documents the type is the document's MIME type.
973 993
974 \sa AppLnk::type(), typeName(), typePixmap(), typeBigPixmap() 994 \sa AppLnk::type(), typeName(), typePixmap(), typeBigPixmap()
975*/ 995*/
976 996
977/*! 997/*!
978 \fn const QList<AppLnk>& AppLnkSet::children() const 998 \fn const QList<AppLnk>& AppLnkSet::children() const
979 999
980 Returns the members of the set. 1000 Returns the members of the set.
981*/ 1001*/
982 1002
983/*! 1003/*!
984 Constructs an empty AppLnkSet. 1004 Constructs an empty AppLnkSet.
985*/ 1005*/
986AppLnkSet::AppLnkSet() : 1006AppLnkSet::AppLnkSet() :
987 d(new AppLnkSetPrivate) 1007 d(new AppLnkSetPrivate)
988{ 1008{
989} 1009}
990 1010
991/*! 1011/*!
992 Constructs an AppLnkSet that contains AppLnk objects representing 1012 Constructs an AppLnkSet that contains AppLnk objects representing
993 all the files in the given \a directory (and any subdirectories 1013 all the files in the given \a directory (and any subdirectories
994 recursively). 1014 recursively).
995 1015
996 \omit 1016 \omit
997 The directories may contain ".directory" files which override 1017 The directories may contain ".directory" files which override
998 any AppLnk::type() values for AppLnk objects found in the directory. 1018 any AppLnk::type() values for AppLnk objects found in the directory.
999 This allows simple localization of application types. 1019 This allows simple localization of application types.
1000 \endomit 1020 \endomit
1001*/ 1021*/
1002AppLnkSet::AppLnkSet( const QString &directory ) : 1022AppLnkSet::AppLnkSet( const QString &directory ) :
1003 d(new AppLnkSetPrivate) 1023 d(new AppLnkSetPrivate)
1004{ 1024{
1005 QDir dir( directory ); 1025 QDir dir( directory );
1006 mFile = directory; 1026 mFile = directory;
1007 findChildren(directory,QString::null,QString::null); 1027 findChildren(directory,QString::null,QString::null);
1008} 1028}
1009 1029
1010/*! 1030/*!
1011 Detaches all AppLnk objects from the set. The set become empty and 1031 Detaches all AppLnk objects from the set. The set become empty and
1012 the caller becomes responsible for deleting the AppLnk objects. 1032 the caller becomes responsible for deleting the AppLnk objects.
1013*/ 1033*/
1014void AppLnkSet::detachChildren() 1034void AppLnkSet::detachChildren()
1015{ 1035{
1016 QListIterator<AppLnk> it( mApps ); 1036 QListIterator<AppLnk> it( mApps );
1017 for ( ; it.current(); ) { 1037 for ( ; it.current(); ) {
1018 AppLnk* a = *it; 1038 AppLnk* a = *it;
1019 ++it; 1039 ++it;
1020 a->mId = 0; 1040 a->mId = 0;
1021 } 1041 }
1022 mApps.clear(); 1042 mApps.clear();
1023} 1043}
1024 1044
1025/*! 1045/*!
1026 Destroys the set, deleting all the AppLnk objects it contains. 1046 Destroys the set, deleting all the AppLnk objects it contains.
1027 1047
1028 \sa detachChildren() 1048 \sa detachChildren()
1029*/ 1049*/
1030AppLnkSet::~AppLnkSet() 1050AppLnkSet::~AppLnkSet()
1031{ 1051{
1032 QListIterator<AppLnk> it( mApps ); 1052 QListIterator<AppLnk> it( mApps );
1033 for ( ; it.current(); ) { 1053 for ( ; it.current(); ) {
1034 AppLnk* a = *it; 1054 AppLnk* a = *it;
1035 ++it; 1055 ++it;
1036 a->mId = 0; 1056 a->mId = 0;
1037 delete a; 1057 delete a;
1038 } 1058 }
1039 delete d; 1059 delete d;
1040} 1060}
1041 1061
1042void AppLnkSet::findChildren(const QString &dr, const QString& typ, const QString& typName, int depth) 1062void AppLnkSet::findChildren(const QString &dr, const QString& typ, const QString& typName, int depth)
1043{ 1063{
1044 depth++; 1064 depth++;
1045 if ( depth > 10 ) 1065 if ( depth > 10 )
1046 return; 1066 return;
1047 1067
1048 QDir dir( dr ); 1068 QDir dir( dr );
1049 QString typNameLocal = typName; 1069 QString typNameLocal = typName;
1050 1070
1051 if ( dir.exists( ".directory" ) ) { 1071 if ( dir.exists( ".directory" ) ) {
1052 Config config( dr + "/.directory", Config::File ); 1072 Config config( dr + "/.directory", Config::File );
1053 config.setGroup( "Desktop Entry" ); 1073 config.setGroup( "Desktop Entry" );
1054 typNameLocal = config.readEntry( "Name", typNameLocal ); 1074 typNameLocal = config.readEntry( "Name", typNameLocal );
1055 if ( !typ.isEmpty() ) { 1075 if ( !typ.isEmpty() ) {
1056 QString iconFile = config.readEntry( "Icon", "AppsIcon" ); 1076 QString iconFile = config.readEntry( "Icon", "AppsIcon" );
1057 QImage unscaledIcon = Resource::loadImage( iconFile ); 1077 QImage unscaledIcon = Resource::loadImage( iconFile );
1058 QPixmap pm, bpm; 1078 QPixmap pm, bpm;
1059 pm.convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) ); 1079 pm.convertFromImage( unscaledIcon.smoothScale( smallSize, smallSize ) );
1060 bpm.convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) ); 1080 bpm.convertFromImage( unscaledIcon.smoothScale( bigSize, bigSize ) );
1061 d->typPix.insert(typ, new QPixmap(pm)); 1081 d->typPix.insert(typ, new QPixmap(pm));
1062 d->typPixBig.insert(typ, new QPixmap(bpm)); 1082 d->typPixBig.insert(typ, new QPixmap(bpm));
1063 d->typName.insert(typ, new QString(typNameLocal)); 1083 d->typName.insert(typ, new QString(typNameLocal));
1064 } 1084 }
1065 } 1085 }
1066 1086
1067 const QFileInfoList *list = dir.entryInfoList(); 1087 const QFileInfoList *list = dir.entryInfoList();
1068 if ( list ) { 1088 if ( list ) {
1069 QFileInfo* fi; 1089 QFileInfo* fi;
1070 bool cadded=FALSE; 1090 bool cadded=FALSE;
1071 for ( QFileInfoListIterator it(*list); (fi=*it); ++it ) { 1091 for ( QFileInfoListIterator it(*list); (fi=*it); ++it ) {
1072 QString bn = fi->fileName(); 1092 QString bn = fi->fileName();
1073 if ( bn[0] != '.' && bn != "CVS" ) { 1093 if ( bn[0] != '.' && bn != "CVS" ) {
1074 if ( fi->isDir() ) { 1094 if ( fi->isDir() ) {
1075 QString c = typ.isNull() ? bn : typ+"/"+bn; 1095 QString c = typ.isNull() ? bn : typ+"/"+bn;
1076 QString d = typNameLocal.isNull() ? bn : typNameLocal+"/"+bn; 1096 QString d = typNameLocal.isNull() ? bn : typNameLocal+"/"+bn;
1077 findChildren(fi->filePath(), c, d, depth ); 1097 findChildren(fi->filePath(), c, d, depth );
1078 } else { 1098 } else {
1079 if ( fi->extension(FALSE) == "desktop" ) { 1099 if ( fi->extension(FALSE) == "desktop" ) {
1080 AppLnk* app = new AppLnk( fi->filePath() ); 1100 AppLnk* app = new AppLnk( fi->filePath() );
1081#ifdef QT_NO_QWS_MULTIPROCESS 1101#ifdef QT_NO_QWS_MULTIPROCESS
1082 if ( !Global::isBuiltinCommand( app->exec() ) ) 1102 if ( !Global::isBuiltinCommand( app->exec() ) )
1083 delete app; 1103 delete app;
1084 else 1104 else
1085#endif 1105#endif
1086 { 1106 {
1087 if ( !typ.isEmpty() ) { 1107 if ( !typ.isEmpty() ) {
1088 if ( !cadded ) { 1108 if ( !cadded ) {
1089 typs.append(typ); 1109 typs.append(typ);
1090 cadded = TRUE; 1110 cadded = TRUE;
1091 } 1111 }
1092 app->setType(typ); 1112 app->setType(typ);
1093 } 1113 }
1094 add(app); 1114 add(app);
1095 } 1115 }
1096 } 1116 }
1097 } 1117 }
1098 } 1118 }
1099 } 1119 }
1100 } 1120 }
1101} 1121}
1102 1122
1103/*! 1123/*!
1104 Adds AppLnk \a f to the set. The set takes responsibility for 1124 Adds AppLnk \a f to the set. The set takes responsibility for
1105 deleting \a f. 1125 deleting \a f.
1106 1126
1107 \sa remove() 1127 \sa remove()
1108*/ 1128*/
1109void AppLnkSet::add( AppLnk *f ) 1129void AppLnkSet::add( AppLnk *f )
1110{ 1130{
1111 if ( f->mId == 0 ) { 1131 if ( f->mId == 0 ) {
1112 AppLnk::lastId++; 1132 AppLnk::lastId++;
1113 f->mId = AppLnk::lastId; 1133 f->mId = AppLnk::lastId;
1114 mApps.append( f ); 1134 mApps.append( f );
1115 } else { 1135 } else {
1116 qWarning("Attempt to add an AppLnk twice"); 1136 qWarning("Attempt to add an AppLnk twice");
1117 } 1137 }
1118} 1138}
1119 1139
1120/*! 1140/*!
1121 Removes AppLnk \a f to the set. The caller becomes responsible for 1141 Removes AppLnk \a f to the set. The caller becomes responsible for
1122 deleting \a f. Returns TRUE if \a f was in the set; otherwise 1142 deleting \a f. Returns TRUE if \a f was in the set; otherwise
1123 returns FALSE. 1143 returns FALSE.
1124 1144
1125 \sa add() 1145 \sa add()
1126*/ 1146*/
1127bool AppLnkSet::remove( AppLnk *f ) 1147bool AppLnkSet::remove( AppLnk *f )
1128{ 1148{
1129 if ( mApps.remove( f ) ) { 1149 if ( mApps.remove( f ) ) {
1130 f->mId = 0; 1150 f->mId = 0;
1131 return TRUE; 1151 return TRUE;
1132 } 1152 }
1133 return FALSE; 1153 return FALSE;
1134} 1154}
1135 1155
1136 1156
1137/*! 1157/*!
1138 Returns the localized name for type \a t. 1158 Returns the localized name for type \a t.
1139 1159
1140 For applications, games and settings the type is \c Application; 1160 For applications, games and settings the type is \c Application;
1141 for documents the type is the document's MIME type. 1161 for documents the type is the document's MIME type.
1142*/ 1162*/
1143QString AppLnkSet::typeName( const QString& t ) const 1163QString AppLnkSet::typeName( const QString& t ) const
1144{ 1164{
1145 QString *st = d->typName.find(t); 1165 QString *st = d->typName.find(t);
1146 return st ? *st : QString::null; 1166 return st ? *st : QString::null;
1147} 1167}
1148 1168
1149/*! 1169/*!
1150 Returns the small pixmap associated with type \a t. 1170 Returns the small pixmap associated with type \a t.
1151 1171
1152 For applications, games and settings the type is \c Application; 1172 For applications, games and settings the type is \c Application;
1153 for documents the type is the document's MIME type. 1173 for documents the type is the document's MIME type.
1154*/ 1174*/
1155QPixmap AppLnkSet::typePixmap( const QString& t ) const 1175QPixmap AppLnkSet::typePixmap( const QString& t ) const
1156{ 1176{
1157 QPixmap *pm = d->typPix.find(t); 1177 QPixmap *pm = d->typPix.find(t);
1158 return pm ? *pm : QPixmap(); 1178 return pm ? *pm : QPixmap();
1159} 1179}
1160 1180
1161/*! 1181/*!
1162 Returns the large pixmap associated with type \a t. 1182 Returns the large pixmap associated with type \a t.
1163 1183
1164 For applications, games and settings the type is \c Application; 1184 For applications, games and settings the type is \c Application;
1165 for documents the type is the document's MIME type. 1185 for documents the type is the document's MIME type.
1166*/ 1186*/
1167QPixmap AppLnkSet::typeBigPixmap( const QString& t ) const 1187QPixmap AppLnkSet::typeBigPixmap( const QString& t ) const
1168{ 1188{
1169 QPixmap *pm = d->typPixBig.find(t); 1189 QPixmap *pm = d->typPixBig.find(t);
1170 return pm ? *pm : QPixmap(); 1190 return pm ? *pm : QPixmap();
1171} 1191}
1172 1192
1173/*! 1193/*!
1174 Returns the AppLnk with the given \a id. 1194 Returns the AppLnk with the given \a id.
1175*/ 1195*/
1176const AppLnk *AppLnkSet::find( int id ) const 1196const AppLnk *AppLnkSet::find( int id ) const
1177{ 1197{
1178 QListIterator<AppLnk> it( children() ); 1198 QListIterator<AppLnk> it( children() );
1179 1199
1180 for ( ; it.current(); ++it ) { 1200 for ( ; it.current(); ++it ) {
1181 const AppLnk *app = it.current(); 1201 const AppLnk *app = it.current();
1182 if ( app->id() == id ) 1202 if ( app->id() == id )
1183 return app; 1203 return app;
1184 } 1204 }
1185 1205
1186 return 0; 1206 return 0;
1187} 1207}
1188 1208
1189/*! 1209/*!
1190 Returns the AppLnk with the given \a exec attribute. 1210 Returns the AppLnk with the given \a exec attribute.
1191*/ 1211*/
1192const AppLnk *AppLnkSet::findExec( const QString& exec ) const 1212const AppLnk *AppLnkSet::findExec( const QString& exec ) const
1193{ 1213{
1194 QListIterator<AppLnk> it( children() ); 1214 QListIterator<AppLnk> it( children() );
1195 1215
1196 for ( ; it.current(); ++it ) { 1216 for ( ; it.current(); ++it ) {
1197 const AppLnk *app = it.current(); 1217 const AppLnk *app = it.current();
1198 if ( app->exec() == exec ) 1218 if ( app->exec() == exec )
1199 return app; 1219 return app;
1200 } 1220 }
1201 1221
1202 return 0; 1222 return 0;
1203} 1223}
1204 1224
1205/*! 1225/*!
1206 \class DocLnkSet applnk.h 1226 \class DocLnkSet applnk.h
1207 \brief The DocLnkSet class is a set of DocLnk objects. 1227 \brief The DocLnkSet class is a set of DocLnk objects.
1208*/ 1228*/
1209 1229
1210/*! 1230/*!
1211 \fn const QList<DocLnk>& DocLnkSet::children() const 1231 \fn const QList<DocLnk>& DocLnkSet::children() const
1212 1232
1213 Returns the members of the set. 1233 Returns the members of the set.
1214*/ 1234*/
1215 1235
1216/*! 1236/*!
1217 Constructs an empty DocLnkSet. 1237 Constructs an empty DocLnkSet.
1218 1238
1219 \sa appendFrom() 1239 \sa appendFrom()
1220*/ 1240*/
1221DocLnkSet::DocLnkSet() 1241DocLnkSet::DocLnkSet()
1222{ 1242{
1223} 1243}
1224 1244
1225/*! 1245/*!
1226 Constructs a DocLnkSet that contains DocLnk objects representing all 1246 Constructs a DocLnkSet that contains DocLnk objects representing all
1227 the files in the \a directory (and any subdirectories, recursively). 1247 the files in the \a directory (and any subdirectories, recursively).
1228 1248
1229 If \a mimefilter is not null, 1249 If \a mimefilter is not null,
1230 only documents with a MIME type matching \a mimefilter are selected. 1250 only documents with a MIME type matching \a mimefilter are selected.
1231 The value may contain multiple wild-card patterns separated by ";", 1251 The value may contain multiple wild-card patterns separated by ";",
1232 such as \c{*o/mpeg;audio/x-wav}. 1252 such as \c{*o/mpeg;audio/x-wav}.
1233 1253
1234 See also \link applnk.html#files-and-links Files and Links\endlink. 1254 See also \link applnk.html#files-and-links Files and Links\endlink.
1235 1255
1236*/ 1256*/
1237DocLnkSet::DocLnkSet( const QString &directory, const QString& mimefilter ) : 1257DocLnkSet::DocLnkSet( const QString &directory, const QString& mimefilter ) :
1238 AppLnkSet() 1258 AppLnkSet()
1239{ 1259{
1240 QDir dir( directory ); 1260 QDir dir( directory );
1241 mFile = dir.dirName(); 1261 mFile = dir.dirName();
1242 QDict<void> reference; 1262 QDict<void> reference;
1243 1263
1244 QStringList subFilter = QStringList::split(";", mimefilter); 1264 QStringList subFilter = QStringList::split(";", mimefilter);
1245 QValueList<QRegExp> mimeFilters; 1265 QValueList<QRegExp> mimeFilters;
1246 for( QStringList::Iterator it = subFilter.begin(); it != subFilter.end(); ++ it ) 1266 for( QStringList::Iterator it = subFilter.begin(); it != subFilter.end(); ++ it )
1247 mimeFilters.append( QRegExp(*it, FALSE, TRUE) ); 1267 mimeFilters.append( QRegExp(*it, FALSE, TRUE) );
1248 1268
1249 findChildren(directory, mimeFilters, reference); 1269 findChildren(directory, mimeFilters, reference);
1250 1270
1251 const QList<DocLnk> &list = children(); 1271 const QList<DocLnk> &list = children();
1252 for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) { 1272 for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) {
1253 reference.remove( (*it)->file() ); 1273 reference.remove( (*it)->file() );
1254 } 1274 }
1255 1275
1256 for ( QDictIterator<void> dit(reference); dit.current(); ++dit ) { 1276 for ( QDictIterator<void> dit(reference); dit.current(); ++dit ) {
1257 if ( dit.current() == (void*)2 ) { 1277 if ( dit.current() == (void*)2 ) {
1258 // Unreferenced, make an unwritten link 1278 // Unreferenced, make an unwritten link
1259 DocLnk* dl = new DocLnk; 1279 DocLnk* dl = new DocLnk;
1260 QFileInfo fi( dit.currentKey() ); 1280 QFileInfo fi( dit.currentKey() );
1261 dl->setFile(fi.filePath()); 1281 dl->setFile(fi.filePath());
1262 dl->setName(fi.baseName()); 1282 dl->setName(fi.baseName());
1263 // #### default to current path? 1283 // #### default to current path?
1264 // dl->setCategories( ... ); 1284 // dl->setCategories( ... );
1265 bool match = mimefilter.isNull(); 1285 bool match = mimefilter.isNull();
1266 if ( !match ) 1286 if ( !match )
1267 for( QValueList<QRegExp>::Iterator it = mimeFilters.begin(); it != mimeFilters.end() && !match; ++ it ) 1287 for( QValueList<QRegExp>::Iterator it = mimeFilters.begin(); it != mimeFilters.end() && !match; ++ it )
1268 if ( (*it).match(dl->type()) >= 0 ) 1288 if ( (*it).match(dl->type()) >= 0 )
1269 match = TRUE; 1289 match = TRUE;
1270 if ( match /* && dl->type() != "application/octet-stream" */ 1290 if ( match /* && dl->type() != "application/octet-stream" */
1271 && !!dl->exec() ) 1291 && !!dl->exec() )
1272 add(dl); 1292 add(dl);
1273 else 1293 else
1274 delete dl; 1294 delete dl;
1275 } 1295 }
1276 } 1296 }
1277} 1297}
1278 1298
1279// other becomes empty 1299// other becomes empty
1280/*! 1300/*!
1281 Transfers all DocLnk objects from \a other to this set. \a other becomes 1301 Transfers all DocLnk objects from \a other to this set. \a other becomes
1282 empty. 1302 empty.
1283*/ 1303*/
1284void DocLnkSet::appendFrom( DocLnkSet& other ) 1304void DocLnkSet::appendFrom( DocLnkSet& other )
1285{ 1305{
1286 if ( &other == this ) 1306 if ( &other == this )
1287 return; 1307 return;
1288 QListIterator<AppLnk> it( other.mApps ); 1308 QListIterator<AppLnk> it( other.mApps );
1289 for ( ; it.current(); ) { 1309 for ( ; it.current(); ) {
1290 mApps.append(*it); 1310 mApps.append(*it);
1291 ++it; 1311 ++it;
1292 } 1312 }
1293 other.mApps.clear(); 1313 other.mApps.clear();
1294} 1314}
1295 1315
1296void DocLnkSet::findChildren(const QString &dr, const QValueList<QRegExp> &mimeFilters, QDict<void> &reference, int depth) 1316void DocLnkSet::findChildren(const QString &dr, const QValueList<QRegExp> &mimeFilters, QDict<void> &reference, int depth)
1297{ 1317{
1298 depth++; 1318 depth++;
1299 if ( depth > 10 ) 1319 if ( depth > 10 )
1300 return; 1320 return;
1301 1321
1302 QDir dir( dr ); 1322 QDir dir( dr );
1303 1323
1304 /* Opie got a different approach 1324 /* Opie got a different approach
1305 * I guess it's geek vs. consumer 1325 * I guess it's geek vs. consumer
1306 * in this case to be discussed 1326 * in this case to be discussed
1307 */ 1327 */
1308 if ( dir.exists( ".Qtopia-ignore" ) ) 1328 if ( dir.exists( ".Qtopia-ignore" ) )
1309 return; 1329 return;
1310 1330
1311 const QFileInfoList *list = dir.entryInfoList(); 1331 const QFileInfoList *list = dir.entryInfoList();
1312 if ( list ) { 1332 if ( list ) {
1313 QFileInfo* fi; 1333 QFileInfo* fi;
1314 for ( QFileInfoListIterator it(*list); (fi=*it); ++it ) { 1334 for ( QFileInfoListIterator it(*list); (fi=*it); ++it ) {
1315 QString bn = fi->fileName(); 1335 QString bn = fi->fileName();
1316 if ( bn[0] != '.' ) { 1336 if ( bn[0] != '.' ) {
1317 if ( fi->isDir() ) { 1337 if ( fi->isDir() ) {
1318 if ( bn != "CVS" && bn != "Qtopia" && bn != "QtPalmtop" ) 1338 if ( bn != "CVS" && bn != "Qtopia" && bn != "QtPalmtop" )
1319 findChildren(fi->filePath(), mimeFilters, reference, depth); 1339 findChildren(fi->filePath(), mimeFilters, reference, depth);
1320 } else { 1340 } else {
1321 if ( fi->extension(FALSE) == "desktop" ) { 1341 if ( fi->extension(FALSE) == "desktop" ) {
1322 DocLnk* dl = new DocLnk( fi->filePath() ); 1342 DocLnk* dl = new DocLnk( fi->filePath() );
1323 QFileInfo fi2(dl->file()); 1343 QFileInfo fi2(dl->file());
1324 bool match = FALSE; 1344 bool match = FALSE;
1325 if ( !fi2.exists() ) { 1345 if ( !fi2.exists() ) {
1326 dir.remove( dl->file() ); 1346 dir.remove( dl->file() );
1327 } 1347 }
1328 if ( mimeFilters.count() == 0 ) { 1348 if ( mimeFilters.count() == 0 ) {
1329 add( dl ); 1349 add( dl );
1330 match = TRUE; 1350 match = TRUE;
1331 } else { 1351 } else {
1332 for( QValueList<QRegExp>::ConstIterator it = mimeFilters.begin(); it != mimeFilters.end(); ++ it ) { 1352 for( QValueList<QRegExp>::ConstIterator it = mimeFilters.begin(); it != mimeFilters.end(); ++ it ) {
1333 if ( (*it).match(dl->type()) >= 0 ) { 1353 if ( (*it).match(dl->type()) >= 0 ) {
1334 add(dl); 1354 add(dl);
1335 match = TRUE; 1355 match = TRUE;
1336 } 1356 }
1337 } 1357 }
1338 } 1358 }
1339 if ( !match ) 1359 if ( !match )
1340 delete dl; 1360 delete dl;
1341 } else { 1361 } else {
1342 if ( !reference.find(fi->fileName()) ) 1362 if ( !reference.find(fi->fileName()) )
1343 reference.insert(fi->filePath(), (void*)2); 1363 reference.insert(fi->filePath(), (void*)2);
1344 } 1364 }
1345 } 1365 }
1346 } 1366 }
1347 } 1367 }
1348 } 1368 }
1349} 1369}
diff --git a/library/applnk.h b/library/applnk.h
index 71b62ef..b92ddba 100644
--- a/library/applnk.h
+++ b/library/applnk.h
@@ -1,207 +1,208 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef __APPLNK_H__ 20#ifndef __APPLNK_H__
21#define __APPLNK_H__ 21#define __APPLNK_H__
22 22
23#include <qobject.h> 23#include <qobject.h>
24#include <qiconset.h> 24#include <qiconset.h>
25#include <qlist.h> 25#include <qlist.h>
26#include <qdict.h> 26#include <qdict.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28 28
29class AppLnkSetPrivate; 29class AppLnkSetPrivate;
30class AppLnkPrivate; 30class AppLnkPrivate;
31 31
32class AppLnk 32class AppLnk
33{ 33{
34public: 34public:
35 AppLnk(); 35 AppLnk();
36 AppLnk( const QString &file ); 36 AppLnk( const QString &file );
37 AppLnk( const AppLnk &copy ); // copy constructor 37 AppLnk( const AppLnk &copy ); // copy constructor
38 virtual ~AppLnk(); 38 virtual ~AppLnk();
39 39
40 bool isValid() const { return !mLinkFile.isNull(); } 40 bool isValid() const { return !mLinkFile.isNull(); }
41 41
42 static void setSmallIconSize(int); 42 static void setSmallIconSize(int);
43 static void setBigIconSize(int); 43 static void setBigIconSize(int);
44 static int smallIconSize(); 44 static int smallIconSize();
45 static int bigIconSize(); 45 static int bigIconSize();
46 46
47 QString name() const { return mName; } 47 QString name() const { return mName; }
48 const QPixmap& pixmap() const; 48 const QPixmap& pixmap() const;
49 const QPixmap& bigPixmap() const; 49 const QPixmap& bigPixmap() const;
50 QString icon() const { return mIconFile; } 50 QString icon() const { return mIconFile; }
51 virtual QString exec() const { return mExec; } 51 virtual QString exec() const { return mExec; }
52 QString type() const; 52 QString type() const;
53 QString rotation() const { return mRotation; } 53 QString rotation() const { return mRotation; }
54 QString comment() const { return mComment; } 54 QString comment() const { return mComment; }
55 QString file() const; 55 QString file() const;
56 QString linkFile() const; 56 QString linkFile() const;
57 QStringList mimeTypes() const { return mMimeTypes; } 57 QStringList mimeTypes() const { return mMimeTypes; }
58 QStringList mimeTypeIcons() const { return mMimeTypeIcons; } 58 QStringList mimeTypeIcons() const { return mMimeTypeIcons; }
59 const QArray<int> &categories() const; 59 const QArray<int> &categories() const;
60 int id() const { return mId; } 60 int id() const { return mId; }
61 61
62 bool fileKnown() const { return !mFile.isNull(); } 62 bool fileKnown() const { return !mFile.isNull(); }
63 bool linkFileKnown() const { return !mLinkFile.isNull(); } 63 bool linkFileKnown() const { return !mLinkFile.isNull(); }
64 64
65 void execute() const; 65 void execute() const;
66 void execute(const QStringList& args) const; 66 void execute(const QStringList& args) const;
67 void removeFiles(); 67 void removeFiles();
68 void removeLinkFile(); 68 void removeLinkFile();
69 69
70 void setName( const QString& docname ); 70 void setName( const QString& docname );
71 void setExec( const QString& exec ); 71 void setExec( const QString& exec );
72 void setFile( const QString& filename ); 72 void setFile( const QString& filename );
73 void setLinkFile( const QString& filename ); 73 void setLinkFile( const QString& filename );
74 void setComment( const QString& comment ); 74 void setComment( const QString& comment );
75 void setType( const QString& mimetype ); 75 void setType( const QString& mimetype );
76 inline void setRotation ( const QString &rotation ) { mRotation = rot; } // inline for BC
76 void setIcon( const QString& iconname ); 77 void setIcon( const QString& iconname );
77 void setCategories( const QArray<int> &v ); 78 void setCategories( const QArray<int> &v );
78 bool writeLink() const; 79 bool writeLink() const;
79 80
80 void setProperty(const QString& key, const QString& value); 81 void setProperty(const QString& key, const QString& value);
81 QString property(const QString& key) const; 82 QString property(const QString& key) const;
82 83
83#ifdef QTOPIA_INTERNAL_PRELOADACCESS 84#ifdef QTOPIA_INTERNAL_PRELOADACCESS
84 bool isPreloaded() const; 85 bool isPreloaded() const;
85 void setPreloaded(bool yesNo); 86 void setPreloaded(bool yesNo);
86#endif 87#endif
87 88
88#ifdef QTOPIA_INTERNAL_APPLNKASSIGN 89#ifdef QTOPIA_INTERNAL_APPLNKASSIGN
89 AppLnk &operator=(const AppLnk &other); 90 AppLnk &operator=(const AppLnk &other);
90#endif 91#endif
91 92
92protected: 93protected:
93 QString mName; 94 QString mName;
94 95
95 /* remove for Qtopia 3.0 -zecke */ 96 /* remove for Qtopia 3.0 -zecke */
96 QPixmap mPixmap; 97 QPixmap mPixmap;
97 98
98 /* remove for Qtopia 3.0 -zecke */ 99 /* remove for Qtopia 3.0 -zecke */
99 QPixmap mBigPixmap; 100 QPixmap mBigPixmap;
100 101
101 QString mExec; 102 QString mExec;
102 QString mType; 103 QString mType;
103 QString mRotation; 104 QString mRotation;
104 QString mComment; 105 QString mComment;
105 QString mFile; 106 QString mFile;
106 QString mLinkFile; 107 QString mLinkFile;
107 QString mIconFile; 108 QString mIconFile;
108 QStringList mMimeTypes; 109 QStringList mMimeTypes;
109 QStringList mMimeTypeIcons; 110 QStringList mMimeTypeIcons;
110 int mId; 111 int mId;
111 static int lastId; 112 static int lastId;
112 AppLnkPrivate *d; 113 AppLnkPrivate *d;
113 friend class AppLnkSet; 114 friend class AppLnkSet;
114 115
115 virtual void invoke(const QStringList& args) const; 116 virtual void invoke(const QStringList& args) const;
116 bool ensureLinkExists() const; 117 bool ensureLinkExists() const;
117 void storeLink() const; 118 void storeLink() const;
118 119
119private: 120private:
120 const QPixmap& pixmap(int pos, int size) const; 121 const QPixmap& pixmap(int pos, int size) const;
121}; 122};
122 123
123class DocLnk : public AppLnk 124class DocLnk : public AppLnk
124{ 125{
125public: 126public:
126 DocLnk(); 127 DocLnk();
127 DocLnk( const DocLnk &o ) : AppLnk(o) { } 128 DocLnk( const DocLnk &o ) : AppLnk(o) { }
128 DocLnk( const QString &file ); 129 DocLnk( const QString &file );
129 DocLnk( const QString &file, bool may_be_desktopfile ); 130 DocLnk( const QString &file, bool may_be_desktopfile );
130 virtual ~DocLnk(); 131 virtual ~DocLnk();
131 132
132 133
133#ifdef QTOPIA_INTERNAL_APPLNKASSIGN 134#ifdef QTOPIA_INTERNAL_APPLNKASSIGN
134 DocLnk &operator=(const DocLnk &other) { AppLnk::operator=(other); return *this; } 135 DocLnk &operator=(const DocLnk &other) { AppLnk::operator=(other); return *this; }
135#endif 136#endif
136 137
137 QString exec() const; 138 QString exec() const;
138 139
139protected: 140protected:
140 void invoke(const QStringList& args) const; 141 void invoke(const QStringList& args) const;
141 142
142private: 143private:
143 void init(const QString &file); 144 void init(const QString &file);
144}; 145};
145 146
146class AppLnkSet 147class AppLnkSet
147{ 148{
148public: 149public:
149 AppLnkSet(); 150 AppLnkSet();
150 AppLnkSet( const QString &dir ); 151 AppLnkSet( const QString &dir );
151 ~AppLnkSet(); 152 ~AppLnkSet();
152 153
153 const AppLnk *find( int id ) const; 154 const AppLnk *find( int id ) const;
154 const AppLnk *findExec( const QString& execname ) const; 155 const AppLnk *findExec( const QString& execname ) const;
155 156
156 QStringList types() const { return typs; } 157 QStringList types() const { return typs; }
157 QString typeName( const QString& ) const; 158 QString typeName( const QString& ) const;
158 QPixmap typePixmap( const QString& ) const; 159 QPixmap typePixmap( const QString& ) const;
159 QPixmap typeBigPixmap( const QString& ) const; 160 QPixmap typeBigPixmap( const QString& ) const;
160 161
161 void add(AppLnk*); 162 void add(AppLnk*);
162 bool remove(AppLnk*); 163 bool remove(AppLnk*);
163 void clear() { 164 void clear() {
164 QListIterator<AppLnk> it( mApps ); 165 QListIterator<AppLnk> it( mApps );
165 for ( ; it.current(); ) { 166 for ( ; it.current(); ) {
166 AppLnk* a = *it; 167 AppLnk* a = *it;
167 ++it; 168 ++it;
168 a->mId = 0; 169 a->mId = 0;
169 delete a; 170 delete a;
170 } 171 }
171 mApps.clear(); 172 mApps.clear();
172 typs.clear(); 173 typs.clear();
173 } 174 }
174 175
175 const QList<AppLnk> &children() const { return mApps; } 176 const QList<AppLnk> &children() const { return mApps; }
176 void detachChildren(); 177 void detachChildren();
177 178
178protected: 179protected:
179 friend class AppLnk; 180 friend class AppLnk;
180 QList<AppLnk> mApps; 181 QList<AppLnk> mApps;
181 QString mFile; 182 QString mFile;
182 QStringList typs; 183 QStringList typs;
183 AppLnkSetPrivate *d; 184 AppLnkSetPrivate *d;
184 185
185private: 186private:
186 AppLnkSet( const AppLnkSet & ); // no copying! 187 AppLnkSet( const AppLnkSet & ); // no copying!
187 void findChildren(const QString &, const QString& t, const QString& lt, int depth = 0); 188 void findChildren(const QString &, const QString& t, const QString& lt, int depth = 0);
188}; 189};
189 190
190class DocLnkSet : public AppLnkSet 191class DocLnkSet : public AppLnkSet
191{ 192{
192public: 193public:
193 DocLnkSet(); 194 DocLnkSet();
194 DocLnkSet( const QString &dir, const QString &mimefilter=QString::null ); 195 DocLnkSet( const QString &dir, const QString &mimefilter=QString::null );
195 196
196 const QList<DocLnk> &children() const { return (const QList<DocLnk> &)mApps; } 197 const QList<DocLnk> &children() const { return (const QList<DocLnk> &)mApps; }
197 198
198 void appendFrom( DocLnkSet& other ); 199 void appendFrom( DocLnkSet& other );
199 200
200private: 201private:
201 DocLnkSet( const DocLnkSet & ); // no copying! 202 DocLnkSet( const DocLnkSet & ); // no copying!
202 void findChildren(const QString &dr, const QValueList<QRegExp> &mimeFilters, QDict<void> &reference, int depth=0); 203 void findChildren(const QString &dr, const QValueList<QRegExp> &mimeFilters, QDict<void> &reference, int depth=0);
203}; 204};
204 205
205 206
206#endif // __APPLNK_H__ 207#endif // __APPLNK_H__
207 208
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp
index 983c677..0b30a9a 100644
--- a/library/lnkproperties.cpp
+++ b/library/lnkproperties.cpp
@@ -1,309 +1,336 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT 21// WARNING: Do *NOT* define this yourself. The SL5xxx from SHARP does NOT
22// have this class. 22// have this class.
23#define QTOPIA_INTERNAL_FSLP 23#define QTOPIA_INTERNAL_FSLP
24#include "lnkproperties.h" 24#include "lnkproperties.h"
25#include "lnkproperties.h" 25#include "lnkproperties.h"
26#include "lnkpropertiesbase_p.h" 26#include "lnkpropertiesbase_p.h"
27#include "ir.h" 27#include "ir.h"
28 28
29#include <qpe/qpeapplication.h>
29#include <qpe/applnk.h> 30#include <qpe/applnk.h>
30#include <qpe/global.h> 31#include <qpe/global.h>
31#include <qpe/categorywidget.h> 32#include <qpe/categorywidget.h>
32#ifdef QWS 33#ifdef QWS
33#include <qpe/qcopenvelope_qws.h> 34#include <qpe/qcopenvelope_qws.h>
34#endif 35#endif
35#include <qpe/filemanager.h> 36#include <qpe/filemanager.h>
36#include <qpe/config.h> 37#include <qpe/config.h>
37#include <qpe/storage.h> 38#include <qpe/storage.h>
38#include <qpe/qpemessagebox.h> 39#include <qpe/qpemessagebox.h>
39 40
40#include <qlineedit.h> 41#include <qlineedit.h>
41#include <qtoolbutton.h> 42#include <qtoolbutton.h>
42#include <qpushbutton.h> 43#include <qpushbutton.h>
43#include <qgroupbox.h> 44#include <qgroupbox.h>
44#include <qcheckbox.h> 45#include <qcheckbox.h>
45#include <qlabel.h> 46#include <qlabel.h>
46#include <qlayout.h> 47#include <qlayout.h>
47#include <qfile.h> 48#include <qfile.h>
48#include <qfileinfo.h> 49#include <qfileinfo.h>
49#include <qmessagebox.h> 50#include <qmessagebox.h>
50#include <qsize.h> 51#include <qsize.h>
51#include <qcombobox.h> 52#include <qcombobox.h>
52#include <qregexp.h> 53#include <qregexp.h>
54#include <qbuttongroup.h>
53 55
54#include <stdlib.h> 56#include <stdlib.h>
55 57
56LnkProperties::LnkProperties( AppLnk* l, QWidget* parent ) 58LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
57 : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 ) 59 : QDialog( parent, 0, TRUE ), lnk(l), fileSize( 0 )
58{ 60{
59 setCaption( tr("Properties") ); 61 setCaption( tr("Properties") );
60 62
61 QVBoxLayout *vbox = new QVBoxLayout( this ); 63 QVBoxLayout *vbox = new QVBoxLayout( this );
62 d = new LnkPropertiesBase( this ); 64 d = new LnkPropertiesBase( this );
63 vbox->add( d ); 65 vbox->add( d );
64 66
65 d->docname->setText(l->name()); 67 d->docname->setText(l->name());
66 QString inf; 68 QString inf;
67 if ( l->type().isEmpty() ) { 69 if ( l->type().isEmpty() ) {
68 d->type->hide(); 70 d->type->hide();
69 d->typeLabel->hide(); 71 d->typeLabel->hide();
70 } else { 72 } else {
71 d->type->setText( l->type() ); 73 d->type->setText( l->type() );
72 } 74 }
73 75
74 if ( l->comment().isEmpty() ) { 76 if ( l->comment().isEmpty() ) {
75 d->comment->hide(); 77 d->comment->hide();
76 d->commentLabel->hide(); 78 d->commentLabel->hide();
77 } else { 79 } else {
78 d->comment->setText( l->comment() ); 80 d->comment->setText( l->comment() );
79 } 81 }
80 82
81 connect(d->beam,SIGNAL(clicked()),this,SLOT(beamLnk())); 83 connect(d->beam,SIGNAL(clicked()),this,SLOT(beamLnk()));
82 if ( lnk->type().contains('/') ) { // A document? (#### better predicate needed) 84 if ( lnk->type().contains('/') ) { // A document? (#### better predicate needed)
83 connect(d->unlink,SIGNAL(clicked()),this,SLOT(unlinkLnk())); 85 connect(d->unlink,SIGNAL(clicked()),this,SLOT(unlinkLnk()));
84 connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk())); 86 connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk()));
85 87
86 d->docname->setReadOnly( FALSE ); 88 d->docname->setReadOnly( FALSE );
87 d->preload->hide(); 89 d->preload->hide();
88 d->spacer->hide(); 90 d->rotate->hide();
91 d->rotateButtons->hide();
92 d->labelspacer->hide();
89 93
90 // ### THIS MUST GO, FIX WIERD BUG in QLAYOUT 94 // ### THIS MUST GO, FIX WIERD BUG in QLAYOUT
91 d->categoryEdit->kludge(); 95 d->categoryEdit->kludge();
92 96
93 d->categoryEdit->setCategories( lnk->categories(), 97 d->categoryEdit->setCategories( lnk->categories(),
94 "Document View", 98 "Document View",
95 tr("Document View") ); 99 tr("Document View") );
96 setupLocations(); 100 setupLocations();
97 } else { 101 } else {
98 d->unlink->hide(); 102 d->unlink->hide();
99 d->duplicate->hide(); 103 d->duplicate->hide();
100 d->beam->hide(); 104 d->beam->hide();
101 d->hline->hide(); 105 d->hline->hide();
102 d->locationLabel->hide(); 106 d->locationLabel->hide();
103 d->locationCombo->hide(); 107 d->locationCombo->hide();
104 108
105 // Can't edit categories, since the app .desktop files are global, 109 // Can't edit categories, since the app .desktop files are global,
106 // possibly read-only. 110 // possibly read-only.
107 d->categoryEdit->hide(); 111 d->categoryEdit->hide();
108 112
109 d->docname->setReadOnly( TRUE ); 113 d->docname->setReadOnly( TRUE );
110 114
111 if ( l->property("CanFastload") == "0" ) 115 if ( l->property("CanFastload") == "0" )
112 d->preload->hide(); 116 d->preload->hide();
117 if ( !l->property("Rotation"). isEmpty ()) {
118 d->rotate->setChecked ( true );
119 d->rotateButtons->setButton(((QPEApplication::defaultRotation()+l->rotation().toInt())%360)/90);
120 }
121 else {
122 d->rotateButtons->setEnabled(false);
123 }
113 124
114 Config cfg("Launcher"); 125 Config cfg("Launcher");
115 cfg.setGroup("Preload"); 126 cfg.setGroup("Preload");
116 QStringList apps = cfg.readListEntry("Apps",','); 127 QStringList apps = cfg.readListEntry("Apps",',');
117 d->preload->setChecked( apps.contains(l->exec()) ); 128 d->preload->setChecked( apps.contains(l->exec()) );
118 if ( Global::isBuiltinCommand(lnk->exec()) ) 129 if ( Global::isBuiltinCommand(lnk->exec()) )
119 d->preload->hide(); // builtins are always fast 130 d->preload->hide(); // builtins are always fast
120 131
121 currentLocation = 0; // apps not movable (yet) 132 currentLocation = 0; // apps not movable (yet)
122 } 133 }
123} 134}
124 135
125LnkProperties::~LnkProperties() 136LnkProperties::~LnkProperties()
126{ 137{
127} 138}
128 139
129void LnkProperties::unlinkLnk() 140void LnkProperties::unlinkLnk()
130{ 141{
131 if ( QPEMessageBox::confirmDelete( this, tr("Delete"), lnk->name() ) ) { 142 if ( QPEMessageBox::confirmDelete( this, tr("Delete"), lnk->name() ) ) {
132 lnk->removeFiles(); 143 lnk->removeFiles();
133 if ( QFile::exists(lnk->file()) ) { 144 if ( QFile::exists(lnk->file()) ) {
134 QMessageBox::warning( this, tr("Delete"), tr("File deletion failed.") ); 145 QMessageBox::warning( this, tr("Delete"), tr("File deletion failed.") );
135 } else { 146 } else {
136 reject(); 147 reject();
137 } 148 }
138 } 149 }
139} 150}
140 151
141void LnkProperties::setupLocations() 152void LnkProperties::setupLocations()
142{ 153{
143 QFileInfo fi( lnk->file() ); 154 QFileInfo fi( lnk->file() );
144 fileSize = fi.size(); 155 fileSize = fi.size();
145 StorageInfo storage; 156 StorageInfo storage;
146 const QList<FileSystem> &fs = storage.fileSystems(); 157 const QList<FileSystem> &fs = storage.fileSystems();
147 QListIterator<FileSystem> it ( fs ); 158 QListIterator<FileSystem> it ( fs );
148 QString s; 159 QString s;
149 QString homeDir = getenv("HOME"); 160 QString homeDir = getenv("HOME");
150 QString hardDiskHome; 161 QString hardDiskHome;
151 QString hardDiskPath; 162 QString hardDiskPath;
152 int index = 0; 163 int index = 0;
153 currentLocation = -1; 164 currentLocation = -1;
154 for ( ; it.current(); ++it ) { 165 for ( ; it.current(); ++it ) {
155 // we add 10k to the file size so we are sure we can also save the desktop file 166 // we add 10k to the file size so we are sure we can also save the desktop file
156 if ( (ulong)(*it)->availBlocks() * (ulong)(*it)->blockSize() > (ulong)fileSize + 10000 ) { 167 if ( (ulong)(*it)->availBlocks() * (ulong)(*it)->blockSize() > (ulong)fileSize + 10000 ) {
157 if ( (*it)->isRemovable() || 168 if ( (*it)->isRemovable() ||
158 (*it)->disk() == "/dev/mtdblock1" || 169 (*it)->disk() == "/dev/mtdblock1" ||
159 (*it)->disk() == "/dev/mtdblock/1" || 170 (*it)->disk() == "/dev/mtdblock/1" ||
160 (*it)->disk().left(13) == "/dev/mtdblock" || 171 (*it)->disk().left(13) == "/dev/mtdblock" ||
161 (*it)->disk() == "/dev/mtdblock6" || 172 (*it)->disk() == "/dev/mtdblock6" ||
162 (*it)->disk() == "tmpfs" ) { 173 (*it)->disk() == "tmpfs" ) {
163 d->locationCombo->insertItem( (*it)->name(), index ); 174 d->locationCombo->insertItem( (*it)->name(), index );
164 locations.append( ( ((*it)->isRemovable() || 175 locations.append( ( ((*it)->isRemovable() ||
165 (*it)->disk() == "/dev/mtdblock6" || 176 (*it)->disk() == "/dev/mtdblock6" ||
166 (*it)->disk() == "tmpfs" ) 177 (*it)->disk() == "tmpfs" )
167 ? (*it)->path() : homeDir) ); 178 ? (*it)->path() : homeDir) );
168 if ( lnk->file().contains( (*it)->path() ) ) { 179 if ( lnk->file().contains( (*it)->path() ) ) {
169 d->locationCombo->setCurrentItem( index ); 180 d->locationCombo->setCurrentItem( index );
170 currentLocation = index; 181 currentLocation = index;
171 } 182 }
172 index++; 183 index++;
173 } else if ( (*it)->name().contains( tr("Hard Disk") ) && 184 } else if ( (*it)->name().contains( tr("Hard Disk") ) &&
174 homeDir.contains( (*it)->path() ) && 185 homeDir.contains( (*it)->path() ) &&
175 (*it)->path().length() > hardDiskHome.length() ) { 186 (*it)->path().length() > hardDiskHome.length() ) {
176 hardDiskHome = (*it)->name(); 187 hardDiskHome = (*it)->name();
177 hardDiskPath = (*it)->path(); 188 hardDiskPath = (*it)->path();
178 } 189 }
179 } 190 }
180 } 191 }
181 if ( !hardDiskHome.isEmpty() ) { 192 if ( !hardDiskHome.isEmpty() ) {
182 d->locationCombo->insertItem( hardDiskHome ); 193 d->locationCombo->insertItem( hardDiskHome );
183 locations.append( hardDiskPath ); 194 locations.append( hardDiskPath );
184 if ( currentLocation == -1 ) { // assume it's the hard disk 195 if ( currentLocation == -1 ) { // assume it's the hard disk
185 d->locationCombo->setCurrentItem( index ); 196 d->locationCombo->setCurrentItem( index );
186 currentLocation = index; 197 currentLocation = index;
187 } 198 }
188 } 199 }
189} 200}
190 201
191void LnkProperties::duplicateLnk() 202void LnkProperties::duplicateLnk()
192{ 203{
193 // The duplicate takes the new properties. 204 // The duplicate takes the new properties.
194 DocLnk newdoc( *((DocLnk *)lnk) ); 205 DocLnk newdoc( *((DocLnk *)lnk) );
195 if ( d->docname->text() == lnk->name() ) 206 if ( d->docname->text() == lnk->name() )
196 newdoc.setName(tr("Copy of ")+d->docname->text()); 207 newdoc.setName(tr("Copy of ")+d->docname->text());
197 else 208 else
198 newdoc.setName(d->docname->text()); 209 newdoc.setName(d->docname->text());
199 210
200 if ( !copyFile( newdoc ) ) { 211 if ( !copyFile( newdoc ) ) {
201 QMessageBox::warning( this, tr("Duplicate"), tr("File copy failed.") ); 212 QMessageBox::warning( this, tr("Duplicate"), tr("File copy failed.") );
202 return; 213 return;
203 } 214 }
204 reject(); 215 reject();
205} 216}
206 217
207bool LnkProperties::moveLnk() 218bool LnkProperties::moveLnk()
208{ 219{
209 DocLnk newdoc( *((DocLnk *)lnk) ); 220 DocLnk newdoc( *((DocLnk *)lnk) );
210 newdoc.setName(d->docname->text()); 221 newdoc.setName(d->docname->text());
211 222
212 if ( !copyFile( newdoc ) ) { 223 if ( !copyFile( newdoc ) ) {
213 QMessageBox::warning( this, tr("Details"), tr("Moving Document failed.") ); 224 QMessageBox::warning( this, tr("Details"), tr("Moving Document failed.") );
214 return FALSE; 225 return FALSE;
215 } 226 }
216 // remove old lnk 227 // remove old lnk
217 lnk->removeFiles(); 228 lnk->removeFiles();
218 229
219 return TRUE; 230 return TRUE;
220} 231}
221 232
222void LnkProperties::beamLnk() 233void LnkProperties::beamLnk()
223{ 234{
224 Ir ir; 235 Ir ir;
225 DocLnk doc( *((DocLnk *)lnk) ); 236 DocLnk doc( *((DocLnk *)lnk) );
226 doc.setName(d->docname->text()); 237 doc.setName(d->docname->text());
227 reject(); 238 reject();
228 ir.send( doc, doc.comment() ); 239 ir.send( doc, doc.comment() );
229} 240}
230 241
231bool LnkProperties::copyFile( DocLnk &newdoc ) 242bool LnkProperties::copyFile( DocLnk &newdoc )
232{ 243{
233 const char *linkExtn = ".desktop"; 244 const char *linkExtn = ".desktop";
234 QString fileExtn; 245 QString fileExtn;
235 int extnPos = lnk->file().findRev( '.' ); 246 int extnPos = lnk->file().findRev( '.' );
236 if ( extnPos > 0 ) 247 if ( extnPos > 0 )
237 fileExtn = lnk->file().mid( extnPos ); 248 fileExtn = lnk->file().mid( extnPos );
238 249
239 QString safename = newdoc.name(); 250 QString safename = newdoc.name();
240 safename.replace(QRegExp("/"),"_"); 251 safename.replace(QRegExp("/"),"_");
241 252
242 QString fn = locations[ d->locationCombo->currentItem() ] 253 QString fn = locations[ d->locationCombo->currentItem() ]
243 + "/Documents/" + newdoc.type() + "/" + safename; 254 + "/Documents/" + newdoc.type() + "/" + safename;
244 if ( QFile::exists(fn + fileExtn) || QFile::exists(fn + linkExtn) ) { 255 if ( QFile::exists(fn + fileExtn) || QFile::exists(fn + linkExtn) ) {
245 int n=1; 256 int n=1;
246 QString nn = fn + "_" + QString::number(n); 257 QString nn = fn + "_" + QString::number(n);
247 while ( QFile::exists(nn+fileExtn) || QFile::exists(nn+linkExtn) ) { 258 while ( QFile::exists(nn+fileExtn) || QFile::exists(nn+linkExtn) ) {
248 n++; 259 n++;
249 nn = fn + "_" + QString::number(n); 260 nn = fn + "_" + QString::number(n);
250 } 261 }
251 fn = nn; 262 fn = nn;
252 } 263 }
253 newdoc.setFile( fn + fileExtn ); 264 newdoc.setFile( fn + fileExtn );
254 newdoc.setLinkFile( fn + linkExtn ); 265 newdoc.setLinkFile( fn + linkExtn );
255 266
256 // Copy file 267 // Copy file
257 FileManager fm; 268 FileManager fm;
258 if ( !fm.copyFile( *lnk, newdoc ) ) 269 if ( !fm.copyFile( *lnk, newdoc ) )
259 return FALSE; 270 return FALSE;
260 return TRUE; 271 return TRUE;
261} 272}
262 273
263void LnkProperties::done(int ok) 274void LnkProperties::done(int ok)
264{ 275{
265 if ( ok ) { 276 if ( ok ) {
266 bool changed=FALSE; 277 bool changed=FALSE;
267 if ( lnk->name() != d->docname->text() ) { 278 if ( lnk->name() != d->docname->text() ) {
268 lnk->setName(d->docname->text()); 279 lnk->setName(d->docname->text());
269 changed=TRUE; 280 changed=TRUE;
270 } 281 }
271 if ( d->categoryEdit->isVisible() ) { 282 if ( d->categoryEdit->isVisible() ) {
272 QArray<int> tmp = d->categoryEdit->newCategories(); 283 QArray<int> tmp = d->categoryEdit->newCategories();
273 if ( lnk->categories() != tmp ) { 284 if ( lnk->categories() != tmp ) {
274 lnk->setCategories( tmp ); 285 lnk->setCategories( tmp );
275 changed = TRUE; 286 changed = TRUE;
276 } 287 }
277 } 288 }
289 if ( !d->rotate->isHidden()) {
290 QString newrot;
291
292 if (d->rotate->isChecked()) {
293 int rot=0;
294 for(; rot<4; rot++) {
295 if (d->rotateButtons->find(rot)->isOn())
296 break;
297 }
298 newrot = QString::number((QPEApplication::defaultRotation()+rot*90)%360);
299 }
300 if (newrot !=lnk->rotation()) {
301 lnk->setRotation(newrot);
302 changed = TRUE;
303 }
304 }
278 if ( d->preload->isHidden() && d->locationCombo->currentItem() != currentLocation ) { 305 if ( d->preload->isHidden() && d->locationCombo->currentItem() != currentLocation ) {
279 moveLnk(); 306 moveLnk();
280 } else if ( changed ) { 307 } else if ( changed ) {
281 lnk->writeLink(); 308 lnk->writeLink();
282 } 309 }
283 310
284 if ( !d->preload->isHidden() ) { 311 if ( !d->preload->isHidden() ) {
285 Config cfg("Launcher"); 312 Config cfg("Launcher");
286 cfg.setGroup("Preload"); 313 cfg.setGroup("Preload");
287 QStringList apps = cfg.readListEntry("Apps",','); 314 QStringList apps = cfg.readListEntry("Apps",',');
288 QString exe = lnk->exec(); 315 QString exe = lnk->exec();
289 if ( apps.contains(exe) != d->preload->isChecked() ) { 316 if ( apps.contains(exe) != d->preload->isChecked() ) {
290 if ( d->preload->isChecked() ) { 317 if ( d->preload->isChecked() ) {
291 apps.append(exe); 318 apps.append(exe);
292#ifndef QT_NO_COP 319#ifndef QT_NO_COP
293 QCopEnvelope e("QPE/Application/"+exe.local8Bit(), 320 QCopEnvelope e("QPE/Application/"+exe.local8Bit(),
294 "enablePreload()"); 321 "enablePreload()");
295#endif 322#endif
296 } else { 323 } else {
297 apps.remove(exe); 324 apps.remove(exe);
298#ifndef QT_NO_COP 325#ifndef QT_NO_COP
299 QCopEnvelope e("QPE/Application/"+exe.local8Bit(), 326 QCopEnvelope e("QPE/Application/"+exe.local8Bit(),
300 "quitIfInvisible()"); 327 "quitIfInvisible()");
301#endif 328#endif
302 } 329 }
303 cfg.writeEntry("Apps",apps,','); 330 cfg.writeEntry("Apps",apps,',');
304 } 331 }
305 } 332 }
306 } 333 }
307 QDialog::done( ok ); 334 QDialog::done( ok );
308} 335}
309 336
diff --git a/library/lnkpropertiesbase_p.ui b/library/lnkpropertiesbase_p.ui
index e7139e7..c2271f1 100644
--- a/library/lnkpropertiesbase_p.ui
+++ b/library/lnkpropertiesbase_p.ui
@@ -1,423 +1,681 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>LnkPropertiesBase</class> 2<class>LnkPropertiesBase</class>
3<widget> 3<widget>
4 <class>QWidget</class> 4 <class>QWidget</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>Form1</cstring> 7 <cstring>Form1</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>289</width> 14 <width>267</width>
15 <height>449</height> 15 <height>450</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>sizePolicy</name> 19 <name>sizePolicy</name>
20 <sizepolicy> 20 <sizepolicy>
21 <hsizetype>5</hsizetype> 21 <hsizetype>5</hsizetype>
22 <vsizetype>5</vsizetype> 22 <vsizetype>5</vsizetype>
23 </sizepolicy> 23 </sizepolicy>
24 </property> 24 </property>
25 <property stdset="1"> 25 <property stdset="1">
26 <name>font</name> 26 <name>font</name>
27 <font> 27 <font>
28 </font> 28 </font>
29 </property> 29 </property>
30 <property stdset="1"> 30 <property stdset="1">
31 <name>caption</name> 31 <name>caption</name>
32 <string>Details</string> 32 <string>Details</string>
33 </property> 33 </property>
34 <property stdset="1">
35 <name>icon</name>
36 <pixmap>image0</pixmap>
37 </property>
34 <property> 38 <property>
35 <name>layoutMargin</name> 39 <name>layoutMargin</name>
36 </property> 40 </property>
37 <property> 41 <property>
38 <name>layoutSpacing</name> 42 <name>layoutSpacing</name>
39 </property> 43 </property>
40 <vbox> 44 <vbox>
41 <property stdset="1"> 45 <property stdset="1">
42 <name>margin</name> 46 <name>margin</name>
43 <number>0</number> 47 <number>0</number>
44 </property> 48 </property>
45 <property stdset="1"> 49 <property stdset="1">
46 <name>spacing</name> 50 <name>spacing</name>
47 <number>0</number> 51 <number>0</number>
48 </property> 52 </property>
49 <widget> 53 <widget>
50 <class>QFrame</class> 54 <class>QFrame</class>
51 <property stdset="1"> 55 <property stdset="1">
52 <name>name</name> 56 <name>name</name>
53 <cstring>Frame8</cstring> 57 <cstring>Frame8</cstring>
54 </property> 58 </property>
55 <property stdset="1"> 59 <property stdset="1">
56 <name>focusPolicy</name> 60 <name>focusPolicy</name>
57 <enum>NoFocus</enum> 61 <enum>NoFocus</enum>
58 </property> 62 </property>
59 <property stdset="1"> 63 <property stdset="1">
60 <name>frameShape</name> 64 <name>frameShape</name>
61 <enum>NoFrame</enum> 65 <enum>NoFrame</enum>
62 </property> 66 </property>
63 <property stdset="1"> 67 <property stdset="1">
64 <name>frameShadow</name> 68 <name>frameShadow</name>
65 <enum>Plain</enum> 69 <enum>Plain</enum>
66 </property> 70 </property>
67 <property> 71 <property>
68 <name>layoutMargin</name> 72 <name>layoutMargin</name>
69 </property> 73 </property>
70 <property> 74 <property>
71 <name>layoutSpacing</name> 75 <name>layoutSpacing</name>
72 </property> 76 </property>
73 <grid> 77 <grid>
74 <property stdset="1"> 78 <property stdset="1">
75 <name>margin</name> 79 <name>margin</name>
76 <number>3</number> 80 <number>3</number>
77 </property> 81 </property>
78 <property stdset="1"> 82 <property stdset="1">
79 <name>spacing</name> 83 <name>spacing</name>
80 <number>3</number> 84 <number>3</number>
81 </property> 85 </property>
82 <widget row="6" column="0" rowspan="1" colspan="2" > 86 <widget row="8" column="0" rowspan="1" colspan="2" >
83 <class>CategoryWidget</class> 87 <class>CategoryWidget</class>
84 <property stdset="1"> 88 <property stdset="1">
85 <name>name</name> 89 <name>name</name>
86 <cstring>categoryEdit</cstring> 90 <cstring>categoryEdit</cstring>
87 </property> 91 </property>
88 <property stdset="1"> 92 <property stdset="1">
89 <name>sizePolicy</name> 93 <name>sizePolicy</name>
90 <sizepolicy> 94 <sizepolicy>
91 <hsizetype>1</hsizetype> 95 <hsizetype>1</hsizetype>
92 <vsizetype>7</vsizetype> 96 <vsizetype>7</vsizetype>
93 </sizepolicy> 97 </sizepolicy>
94 </property> 98 </property>
95 </widget> 99 </widget>
96 <widget row="5" column="0" rowspan="1" colspan="2" > 100 <widget row="5" column="0" rowspan="1" colspan="2" >
97 <class>QLabel</class> 101 <class>QCheckBox</class>
98 <property stdset="1"> 102 <property stdset="1">
99 <name>name</name> 103 <name>name</name>
100 <cstring>spacer</cstring> 104 <cstring>rotate</cstring>
101 </property>
102 <property stdset="1">
103 <name>sizePolicy</name>
104 <sizepolicy>
105 <hsizetype>1</hsizetype>
106 <vsizetype>7</vsizetype>
107 </sizepolicy>
108 </property> 105 </property>
109 <property stdset="1"> 106 <property stdset="1">
110 <name>text</name> 107 <name>text</name>
111 <string></string> 108 <string>Use custom rotation</string>
112 </property> 109 </property>
113 </widget> 110 <property>
114 <widget row="3" column="0" > 111 <name>layoutMargin</name>
115 <class>QLabel</class>
116 <property stdset="1">
117 <name>name</name>
118 <cstring>commentLabel</cstring>
119 </property> 112 </property>
120 <property stdset="1"> 113 <property>
121 <name>text</name> 114 <name>layoutSpacing</name>
122 <string>Comment:</string> 115 </property>
116 <property>
117 <name>whatsThis</name>
118 <string>Preload this application so that it is available instantly.</string>
123 </property> 119 </property>
124 </widget> 120 </widget>
125 <widget row="2" column="0" > 121 <widget row="0" column="1" >
126 <class>QLabel</class> 122 <class>QLineEdit</class>
127 <property stdset="1"> 123 <property stdset="1">
128 <name>name</name> 124 <name>name</name>
129 <cstring>typeLabel</cstring> 125 <cstring>docname</cstring>
130 </property> 126 </property>
131 <property stdset="1"> 127 <property stdset="1">
132 <name>focusPolicy</name> 128 <name>sizePolicy</name>
133 <enum>NoFocus</enum> 129 <sizepolicy>
130 <hsizetype>7</hsizetype>
131 <vsizetype>0</vsizetype>
132 </sizepolicy>
134 </property> 133 </property>
135 <property stdset="1"> 134 <property stdset="1">
136 <name>text</name> 135 <name>text</name>
137 <string>Type:</string> 136 <string></string>
138 </property>
139 <property>
140 <name>layoutMargin</name>
141 </property> 137 </property>
142 <property> 138 <property>
143 <name>layoutSpacing</name> 139 <name>whatsThis</name>
140 <string>The name of this document.</string>
144 </property> 141 </property>
145 </widget> 142 </widget>
146 <widget row="1" column="1" > 143 <widget row="1" column="1" >
147 <class>QComboBox</class> 144 <class>QComboBox</class>
148 <property stdset="1"> 145 <property stdset="1">
149 <name>name</name> 146 <name>name</name>
150 <cstring>locationCombo</cstring> 147 <cstring>locationCombo</cstring>
151 </property> 148 </property>
152 <property stdset="1"> 149 <property stdset="1">
153 <name>sizePolicy</name> 150 <name>sizePolicy</name>
154 <sizepolicy> 151 <sizepolicy>
155 <hsizetype>7</hsizetype> 152 <hsizetype>7</hsizetype>
156 <vsizetype>0</vsizetype> 153 <vsizetype>0</vsizetype>
157 </sizepolicy> 154 </sizepolicy>
158 </property> 155 </property>
159 <property> 156 <property>
160 <name>whatsThis</name> 157 <name>whatsThis</name>
161 <string>The media the document resides on.</string> 158 <string>The media the document resides on.</string>
162 </property> 159 </property>
163 </widget> 160 </widget>
164 <widget row="0" column="1" > 161 <widget row="2" column="0" >
165 <class>QLineEdit</class> 162 <class>QLabel</class>
166 <property stdset="1"> 163 <property stdset="1">
167 <name>name</name> 164 <name>name</name>
168 <cstring>docname</cstring> 165 <cstring>typeLabel</cstring>
169 </property> 166 </property>
170 <property stdset="1"> 167 <property stdset="1">
171 <name>sizePolicy</name> 168 <name>focusPolicy</name>
172 <sizepolicy> 169 <enum>NoFocus</enum>
173 <hsizetype>7</hsizetype>
174 <vsizetype>0</vsizetype>
175 </sizepolicy>
176 </property> 170 </property>
177 <property stdset="1"> 171 <property stdset="1">
178 <name>text</name> 172 <name>text</name>
179 <string></string> 173 <string>Type:</string>
180 </property> 174 </property>
181 <property> 175 <property>
182 <name>whatsThis</name> 176 <name>layoutMargin</name>
183 <string>The name of this document.</string> 177 </property>
178 <property>
179 <name>layoutSpacing</name>
184 </property> 180 </property>
185 </widget> 181 </widget>
186 <widget row="0" column="0" > 182 <widget row="2" column="1" >
187 <class>QLabel</class> 183 <class>QLabel</class>
188 <property stdset="1"> 184 <property stdset="1">
189 <name>name</name> 185 <name>name</name>
190 <cstring>TextLabel1</cstring> 186 <cstring>type</cstring>
191 </property>
192 <property stdset="1">
193 <name>frameShadow</name>
194 <enum>MShadow</enum>
195 </property> 187 </property>
196 <property stdset="1"> 188 <property stdset="1">
197 <name>text</name> 189 <name>text</name>
198 <string>Name:</string> 190 <string></string>
199 </property> 191 </property>
200 </widget> 192 </widget>
201 <widget row="1" column="0" > 193 <widget row="1" column="0" >
202 <class>QLabel</class> 194 <class>QLabel</class>
203 <property stdset="1"> 195 <property stdset="1">
204 <name>name</name> 196 <name>name</name>
205 <cstring>locationLabel</cstring> 197 <cstring>locationLabel</cstring>
206 </property> 198 </property>
207 <property stdset="1"> 199 <property stdset="1">
208 <name>sizePolicy</name> 200 <name>sizePolicy</name>
209 <sizepolicy> 201 <sizepolicy>
210 <hsizetype>1</hsizetype> 202 <hsizetype>1</hsizetype>
211 <vsizetype>1</vsizetype> 203 <vsizetype>1</vsizetype>
212 </sizepolicy> 204 </sizepolicy>
213 </property> 205 </property>
214 <property stdset="1"> 206 <property stdset="1">
215 <name>caption</name> 207 <name>caption</name>
216 <string></string> 208 <string></string>
217 </property> 209 </property>
218 <property stdset="1"> 210 <property stdset="1">
219 <name>text</name> 211 <name>text</name>
220 <string>Location:</string> 212 <string>Location:</string>
221 </property> 213 </property>
222 <property> 214 <property>
223 <name>layoutMargin</name> 215 <name>layoutMargin</name>
224 </property> 216 </property>
225 <property> 217 <property>
226 <name>layoutSpacing</name> 218 <name>layoutSpacing</name>
227 </property> 219 </property>
228 </widget> 220 </widget>
229 <widget row="2" column="1" > 221 <widget row="0" column="0" >
230 <class>QLabel</class> 222 <class>QLabel</class>
231 <property stdset="1"> 223 <property stdset="1">
232 <name>name</name> 224 <name>name</name>
233 <cstring>type</cstring> 225 <cstring>TextLabel1</cstring>
226 </property>
227 <property stdset="1">
228 <name>frameShadow</name>
229 <enum>MShadow</enum>
234 </property> 230 </property>
235 <property stdset="1"> 231 <property stdset="1">
236 <name>text</name> 232 <name>text</name>
237 <string></string> 233 <string>Name:</string>
238 </property> 234 </property>
239 </widget> 235 </widget>
240 <widget row="3" column="1" > 236 <widget row="3" column="1" >
241 <class>QLabel</class> 237 <class>QLabel</class>
242 <property stdset="1"> 238 <property stdset="1">
243 <name>name</name> 239 <name>name</name>
244 <cstring>comment</cstring> 240 <cstring>comment</cstring>
245 </property> 241 </property>
246 <property stdset="1"> 242 <property stdset="1">
247 <name>text</name> 243 <name>text</name>
248 <string></string> 244 <string></string>
249 </property> 245 </property>
250 </widget> 246 </widget>
247 <widget row="6" column="0" rowspan="1" colspan="2" >
248 <class>QButtonGroup</class>
249 <property stdset="1">
250 <name>name</name>
251 <cstring>rotateButtons</cstring>
252 </property>
253 <property stdset="1">
254 <name>frameShape</name>
255 <enum>NoFrame</enum>
256 </property>
257 <property stdset="1">
258 <name>title</name>
259 <string></string>
260 </property>
261 <property stdset="1">
262 <name>exclusive</name>
263 <bool>true</bool>
264 </property>
265 <property>
266 <name>layoutMargin</name>
267 </property>
268 <property>
269 <name>layoutSpacing</name>
270 </property>
271 <hbox>
272 <property stdset="1">
273 <name>margin</name>
274 <number>0</number>
275 </property>
276 <property stdset="1">
277 <name>spacing</name>
278 <number>3</number>
279 </property>
280 <spacer>
281 <property>
282 <name>name</name>
283 <cstring>s1</cstring>
284 </property>
285 <property stdset="1">
286 <name>orientation</name>
287 <enum>Horizontal</enum>
288 </property>
289 <property stdset="1">
290 <name>sizeType</name>
291 <enum>Fixed</enum>
292 </property>
293 <property>
294 <name>sizeHint</name>
295 <size>
296 <width>20</width>
297 <height>28</height>
298 </size>
299 </property>
300 </spacer>
301 <widget>
302 <class>QToolButton</class>
303 <property stdset="1">
304 <name>name</name>
305 <cstring>ToolButton1</cstring>
306 </property>
307 <property stdset="1">
308 <name>text</name>
309 <string></string>
310 </property>
311 <property stdset="1">
312 <name>pixmap</name>
313 <pixmap>image0</pixmap>
314 </property>
315 <property stdset="1">
316 <name>toggleButton</name>
317 <bool>true</bool>
318 </property>
319 <property stdset="1">
320 <name>on</name>
321 <bool>false</bool>
322 </property>
323 <property stdset="1">
324 <name>usesBigPixmap</name>
325 <bool>true</bool>
326 </property>
327 <property stdset="1">
328 <name>toggleButton</name>
329 <bool>true</bool>
330 </property>
331 <property stdset="1">
332 <name>on</name>
333 <bool>false</bool>
334 </property>
335 <property stdset="1">
336 <name>buttonGroupId</name>
337 <number>0</number>
338 </property>
339 </widget>
340 <widget>
341 <class>QToolButton</class>
342 <property stdset="1">
343 <name>name</name>
344 <cstring>ToolButton2</cstring>
345 </property>
346 <property stdset="1">
347 <name>text</name>
348 <string></string>
349 </property>
350 <property stdset="1">
351 <name>pixmap</name>
352 <pixmap>image1</pixmap>
353 </property>
354 <property stdset="1">
355 <name>toggleButton</name>
356 <bool>true</bool>
357 </property>
358 <property stdset="1">
359 <name>usesBigPixmap</name>
360 <bool>true</bool>
361 </property>
362 <property stdset="1">
363 <name>toggleButton</name>
364 <bool>true</bool>
365 </property>
366 <property stdset="1">
367 <name>buttonGroupId</name>
368 <number>1</number>
369 </property>
370 </widget>
371 <widget>
372 <class>QToolButton</class>
373 <property stdset="1">
374 <name>name</name>
375 <cstring>ToolButton3</cstring>
376 </property>
377 <property stdset="1">
378 <name>text</name>
379 <string></string>
380 </property>
381 <property stdset="1">
382 <name>pixmap</name>
383 <pixmap>image2</pixmap>
384 </property>
385 <property stdset="1">
386 <name>toggleButton</name>
387 <bool>true</bool>
388 </property>
389 <property stdset="1">
390 <name>usesBigPixmap</name>
391 <bool>true</bool>
392 </property>
393 <property stdset="1">
394 <name>toggleButton</name>
395 <bool>true</bool>
396 </property>
397 <property stdset="1">
398 <name>buttonGroupId</name>
399 <number>2</number>
400 </property>
401 </widget>
402 <widget>
403 <class>QToolButton</class>
404 <property stdset="1">
405 <name>name</name>
406 <cstring>ToolButton4</cstring>
407 </property>
408 <property stdset="1">
409 <name>text</name>
410 <string></string>
411 </property>
412 <property stdset="1">
413 <name>pixmap</name>
414 <pixmap>image3</pixmap>
415 </property>
416 <property stdset="1">
417 <name>toggleButton</name>
418 <bool>true</bool>
419 </property>
420 <property stdset="1">
421 <name>usesBigPixmap</name>
422 <bool>true</bool>
423 </property>
424 <property stdset="1">
425 <name>toggleButton</name>
426 <bool>true</bool>
427 </property>
428 <property stdset="1">
429 <name>buttonGroupId</name>
430 <number>3</number>
431 </property>
432 </widget>
433 <spacer>
434 <property>
435 <name>name</name>
436 <cstring>s4</cstring>
437 </property>
438 <property stdset="1">
439 <name>orientation</name>
440 <enum>Horizontal</enum>
441 </property>
442 <property stdset="1">
443 <name>sizeType</name>
444 <enum>MinimumExpanding</enum>
445 </property>
446 <property>
447 <name>sizeHint</name>
448 <size>
449 <width>20</width>
450 <height>20</height>
451 </size>
452 </property>
453 </spacer>
454 </hbox>
455 </widget>
456 <widget row="7" column="0" rowspan="1" colspan="2" >
457 <class>QLabel</class>
458 <property stdset="1">
459 <name>name</name>
460 <cstring>labelspacer</cstring>
461 </property>
462 <property stdset="1">
463 <name>sizePolicy</name>
464 <sizepolicy>
465 <hsizetype>1</hsizetype>
466 <vsizetype>7</vsizetype>
467 </sizepolicy>
468 </property>
469 <property stdset="1">
470 <name>text</name>
471 <string></string>
472 </property>
473 </widget>
251 <widget row="4" column="0" rowspan="1" colspan="2" > 474 <widget row="4" column="0" rowspan="1" colspan="2" >
252 <class>QCheckBox</class> 475 <class>QCheckBox</class>
253 <property stdset="1"> 476 <property stdset="1">
254 <name>name</name> 477 <name>name</name>
255 <cstring>preload</cstring> 478 <cstring>preload</cstring>
256 </property> 479 </property>
257 <property stdset="1"> 480 <property stdset="1">
258 <name>text</name> 481 <name>text</name>
259 <string>Fast load (consumes memory)</string> 482 <string>Fast load (consumes memory)</string>
260 </property> 483 </property>
261 <property> 484 <property>
262 <name>layoutMargin</name> 485 <name>layoutMargin</name>
263 </property> 486 </property>
264 <property> 487 <property>
265 <name>layoutSpacing</name> 488 <name>layoutSpacing</name>
266 </property> 489 </property>
267 <property> 490 <property>
268 <name>whatsThis</name> 491 <name>whatsThis</name>
269 <string>Preload this application so that it is available instantly.</string> 492 <string>Preload this application so that it is available instantly.</string>
270 </property> 493 </property>
271 </widget> 494 </widget>
495 <widget row="3" column="0" >
496 <class>QLabel</class>
497 <property stdset="1">
498 <name>name</name>
499 <cstring>commentLabel</cstring>
500 </property>
501 <property stdset="1">
502 <name>text</name>
503 <string>Comment:</string>
504 </property>
505 </widget>
272 </grid> 506 </grid>
273 </widget> 507 </widget>
274 <widget> 508 <widget>
275 <class>Line</class> 509 <class>Line</class>
276 <property stdset="1"> 510 <property stdset="1">
277 <name>name</name> 511 <name>name</name>
278 <cstring>hline</cstring> 512 <cstring>hline</cstring>
279 </property> 513 </property>
280 <property stdset="1"> 514 <property stdset="1">
281 <name>frameShadow</name> 515 <name>frameShadow</name>
282 <enum>Sunken</enum> 516 <enum>Sunken</enum>
283 </property> 517 </property>
284 <property stdset="1"> 518 <property stdset="1">
285 <name>orientation</name> 519 <name>orientation</name>
286 <enum>Horizontal</enum> 520 <enum>Horizontal</enum>
287 </property> 521 </property>
288 <property> 522 <property>
289 <name>layoutMargin</name> 523 <name>layoutMargin</name>
290 </property> 524 </property>
291 <property> 525 <property>
292 <name>layoutSpacing</name> 526 <name>layoutSpacing</name>
293 </property> 527 </property>
294 </widget> 528 </widget>
295 <widget> 529 <widget>
296 <class>QFrame</class> 530 <class>QFrame</class>
297 <property stdset="1"> 531 <property stdset="1">
298 <name>name</name> 532 <name>name</name>
299 <cstring>Frame9</cstring> 533 <cstring>Frame9</cstring>
300 </property> 534 </property>
301 <property stdset="1"> 535 <property stdset="1">
302 <name>frameShape</name> 536 <name>frameShape</name>
303 <enum>NoFrame</enum> 537 <enum>NoFrame</enum>
304 </property> 538 </property>
305 <property stdset="1"> 539 <property stdset="1">
306 <name>frameShadow</name> 540 <name>frameShadow</name>
307 <enum>Plain</enum> 541 <enum>Plain</enum>
308 </property> 542 </property>
309 <property> 543 <property>
310 <name>layoutMargin</name> 544 <name>layoutMargin</name>
311 </property> 545 </property>
312 <property> 546 <property>
313 <name>layoutSpacing</name> 547 <name>layoutSpacing</name>
314 </property> 548 </property>
315 <hbox> 549 <hbox>
316 <property stdset="1"> 550 <property stdset="1">
317 <name>margin</name> 551 <name>margin</name>
318 <number>3</number> 552 <number>3</number>
319 </property> 553 </property>
320 <property stdset="1"> 554 <property stdset="1">
321 <name>spacing</name> 555 <name>spacing</name>
322 <number>5</number> 556 <number>5</number>
323 </property> 557 </property>
324 <widget> 558 <widget>
325 <class>QPushButton</class> 559 <class>QPushButton</class>
326 <property stdset="1"> 560 <property stdset="1">
327 <name>name</name> 561 <name>name</name>
328 <cstring>unlink</cstring> 562 <cstring>unlink</cstring>
329 </property> 563 </property>
330 <property stdset="1"> 564 <property stdset="1">
331 <name>focusPolicy</name> 565 <name>focusPolicy</name>
332 <enum>TabFocus</enum> 566 <enum>TabFocus</enum>
333 </property> 567 </property>
334 <property stdset="1"> 568 <property stdset="1">
335 <name>text</name> 569 <name>text</name>
336 <string>Delete</string> 570 <string>Delete</string>
337 </property> 571 </property>
338 <property stdset="1"> 572 <property stdset="1">
339 <name>autoDefault</name> 573 <name>autoDefault</name>
340 <bool>false</bool> 574 <bool>false</bool>
341 </property> 575 </property>
342 <property> 576 <property>
343 <name>whatsThis</name> 577 <name>whatsThis</name>
344 <string>Delete this document.</string> 578 <string>Delete this document.</string>
345 </property> 579 </property>
346 </widget> 580 </widget>
347 <widget> 581 <widget>
348 <class>QPushButton</class> 582 <class>QPushButton</class>
349 <property stdset="1"> 583 <property stdset="1">
350 <name>name</name> 584 <name>name</name>
351 <cstring>duplicate</cstring> 585 <cstring>duplicate</cstring>
352 </property> 586 </property>
353 <property stdset="1"> 587 <property stdset="1">
354 <name>text</name> 588 <name>text</name>
355 <string>Copy</string> 589 <string>Copy</string>
356 </property> 590 </property>
357 <property stdset="1"> 591 <property stdset="1">
358 <name>autoDefault</name> 592 <name>autoDefault</name>
359 <bool>false</bool> 593 <bool>false</bool>
360 </property> 594 </property>
361 <property> 595 <property>
362 <name>whatsThis</name> 596 <name>whatsThis</name>
363 <string>Make a copy of this document.</string> 597 <string>Make a copy of this document.</string>
364 </property> 598 </property>
365 </widget> 599 </widget>
366 <widget> 600 <widget>
367 <class>QPushButton</class> 601 <class>QPushButton</class>
368 <property stdset="1"> 602 <property stdset="1">
369 <name>name</name> 603 <name>name</name>
370 <cstring>beam</cstring> 604 <cstring>beam</cstring>
371 </property> 605 </property>
372 <property stdset="1"> 606 <property stdset="1">
373 <name>focusPolicy</name> 607 <name>focusPolicy</name>
374 <enum>TabFocus</enum> 608 <enum>TabFocus</enum>
375 </property> 609 </property>
376 <property stdset="1"> 610 <property stdset="1">
377 <name>text</name> 611 <name>text</name>
378 <string>Beam</string> 612 <string>Beam</string>
379 </property> 613 </property>
380 <property stdset="1"> 614 <property stdset="1">
381 <name>autoDefault</name> 615 <name>autoDefault</name>
382 <bool>false</bool> 616 <bool>false</bool>
383 </property> 617 </property>
384 <property> 618 <property>
385 <name>whatsThis</name> 619 <name>whatsThis</name>
386 <string>Beam this document to another device.</string> 620 <string>Beam this document to another device.</string>
387 </property> 621 </property>
388 </widget> 622 </widget>
389 </hbox> 623 </hbox>
390 </widget> 624 </widget>
391 </vbox> 625 </vbox>
392</widget> 626</widget>
393<customwidgets> 627<customwidgets>
394 <customwidget> 628 <customwidget>
395 <class>CategoryWidget</class> 629 <class>CategoryWidget</class>
396 <header location="global">qpe/categorywidget.h</header> 630 <header location="global">qpe/categorywidget.h</header>
397 <sizehint> 631 <sizehint>
398 <width>-1</width> 632 <width>-1</width>
399 <height>-1</height> 633 <height>-1</height>
400 </sizehint> 634 </sizehint>
401 <container>0</container> 635 <container>0</container>
402 <sizepolicy> 636 <sizepolicy>
403 <hordata>7</hordata> 637 <hordata>7</hordata>
404 <verdata>7</verdata> 638 <verdata>7</verdata>
405 </sizepolicy> 639 </sizepolicy>
406 <pixmap>image0</pixmap> 640 <pixmap>image4</pixmap>
407 </customwidget> 641 </customwidget>
408</customwidgets> 642</customwidgets>
409<images> 643<images>
410 <image> 644 <image>
411 <name>image0</name> 645 <name>image0</name>
646 <data format="XPM.GZ" length="1226">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523236520022230543251d2e253d856405bffcbc54105b19c856360003b014013032d4282b2b13366708a951067908240fa6a00a95612cb01a6528d04362e92158e0a40213830510c4546598dd103570b72098482ea3ae1ac2eec1ef2f6565d4f051c6123e3035f8c1a81a2aa8a9b5e60200f6abd263</data>
647 </image>
648 <image>
649 <name>image1</name>
650 <data format="XPM.GZ" length="1226">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523236520022230543251d2e253d856405bffcbc54105b19c856360003b01416a0ac8c6053a2061960aa019b806c0ca61a65a81a7c764125e9a486b07b40d2cacaf8fd0555a4875f0d0620cf1c22dc33d8c2197fda504605e4ab41b5129f7b3001b630c46317f16a88cb17c814add5d02ecdd75a730100b509d263</data>
651 </image>
652 <image>
653 <name>image2</name>
654 <data format="XPM.GZ" length="1226">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523236520022230543251d2e253d856405bffcbc54105b19c856360003b0140130aa863a6a9495f5f49441002c02664030840d53a3ac0c53a40c67c25950bb60d27a70857a08268a7b20164059082695d510e31e62fc85193e7aa8e1832568a1eaf1c6c5e053a34c500d0a18b66a6aadb9001be4d263</data>
655 </image>
656 <image>
657 <name>image3</name>
658 <data format="XPM.GZ" length="1226">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523236520022230543251d2e253d856405bffcbc54105b19c856360003b014125006013d5480a64659198b22543510697445e86a9029daaad183ba87809bb1788c7435d8019a392872cad8d5a002b2d510e777648ad66a08a70d62d2185169152b1819699ec870c634869cf48c1e7cc4aba9b5e602005d86d263</data>
659 </image>
660 <image>
661 <name>image4</name>
412 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> 662 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
413 </image> 663 </image>
414</images> 664</images>
665<connections>
666 <connection>
667 <sender>rotate</sender>
668 <signal>toggled(bool)</signal>
669 <receiver>rotateButtons</receiver>
670 <slot>setEnabled(bool)</slot>
671 </connection>
672</connections>
415<tabstops> 673<tabstops>
416 <tabstop>docname</tabstop> 674 <tabstop>docname</tabstop>
417 <tabstop>preload</tabstop> 675 <tabstop>preload</tabstop>
418 <tabstop>locationCombo</tabstop> 676 <tabstop>locationCombo</tabstop>
419 <tabstop>unlink</tabstop> 677 <tabstop>unlink</tabstop>
420 <tabstop>duplicate</tabstop> 678 <tabstop>duplicate</tabstop>
421 <tabstop>beam</tabstop> 679 <tabstop>beam</tabstop>
422</tabstops> 680</tabstops>
423</UI> 681</UI>