summaryrefslogtreecommitdiff
path: root/library/lnkproperties.cpp
Unidiff
Diffstat (limited to 'library/lnkproperties.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/lnkproperties.cpp48
1 files changed, 21 insertions, 27 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp
index c020328..983c677 100644
--- a/library/lnkproperties.cpp
+++ b/library/lnkproperties.cpp
@@ -1,5 +1,5 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
@@ -31,3 +31,5 @@
31#include <qpe/categorywidget.h> 31#include <qpe/categorywidget.h>
32#ifdef QWS
32#include <qpe/qcopenvelope_qws.h> 33#include <qpe/qcopenvelope_qws.h>
34#endif
33#include <qpe/filemanager.h> 35#include <qpe/filemanager.h>
@@ -56,2 +58,4 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
56{ 58{
59 setCaption( tr("Properties") );
60
57 QVBoxLayout *vbox = new QVBoxLayout( this ); 61 QVBoxLayout *vbox = new QVBoxLayout( this );
@@ -80,3 +84,2 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
80 connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk())); 84 connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk()));
81 connect(d->delicon,SIGNAL(clicked()),this,SLOT(unlinkIcon()));
82 85
@@ -119,3 +122,2 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
119 } 122 }
120 setCaption( l->file());
121} 123}
@@ -129,6 +131,3 @@ void LnkProperties::unlinkLnk()
129 if ( QPEMessageBox::confirmDelete( this, tr("Delete"), lnk->name() ) ) { 131 if ( QPEMessageBox::confirmDelete( this, tr("Delete"), lnk->name() ) ) {
130 if ( QFile::exists(lnk->file()) )
131 lnk->removeFiles(); 132 lnk->removeFiles();
132 else
133 QMessageBox::warning( this, tr("Delete"), tr("File does not exist.") );
134 if ( QFile::exists(lnk->file()) ) { 133 if ( QFile::exists(lnk->file()) ) {
@@ -141,18 +140,2 @@ void LnkProperties::unlinkLnk()
141 140
142
143/*
144 * remove only the link from documents, not also the file
145 */
146void LnkProperties::unlinkIcon()
147{
148 if ( QPEMessageBox::confirmDelete( this, tr("Delete Icon and leave file"), lnk->name() ) ) {
149 lnk->removeLinkFile();
150 if ( QFile::exists(lnk->linkFile()) ) {
151 QMessageBox::warning( this, tr("Delete"), tr("Icon deletion failed.") );
152 } else {
153 reject();
154 }
155 }
156}
157
158void LnkProperties::setupLocations() 141void LnkProperties::setupLocations()
@@ -172,9 +155,14 @@ void LnkProperties::setupLocations()
172 // we add 10k to the file size so we are sure we can also save the desktop file 155 // we add 10k to the file size so we are sure we can also save the desktop file
173 if ( (*it)->availBlocks() * (*it)->blockSize() > fileSize + 10000 ) { 156 if ( (ulong)(*it)->availBlocks() * (ulong)(*it)->blockSize() > (ulong)fileSize + 10000 ) {
174 if ( (*it)->isRemovable() || 157 if ( (*it)->isRemovable() ||
175 (*it)->disk() == "/dev/mtdblock1" || 158 (*it)->disk() == "/dev/mtdblock1" ||
176 (*it)->disk() == "/dev/mtdblock/1" || (*it)->disk().left(13) == "/dev/mtdblock" || 159 (*it)->disk() == "/dev/mtdblock/1" ||
177 (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ) { 160 (*it)->disk().left(13) == "/dev/mtdblock" ||
161 (*it)->disk() == "/dev/mtdblock6" ||
162 (*it)->disk() == "tmpfs" ) {
178 d->locationCombo->insertItem( (*it)->name(), index ); 163 d->locationCombo->insertItem( (*it)->name(), index );
179 locations.append( ((*it)->isRemovable() || (*it)->disk() == "/dev/mtdblock6" || (*it)->disk() == "tmpfs" ? (*it)->path() : homeDir) ); 164 locations.append( ( ((*it)->isRemovable() ||
165 (*it)->disk() == "/dev/mtdblock6" ||
166 (*it)->disk() == "tmpfs" )
167 ? (*it)->path() : homeDir) );
180 if ( lnk->file().contains( (*it)->path() ) ) { 168 if ( lnk->file().contains( (*it)->path() ) ) {
@@ -237,2 +225,4 @@ void LnkProperties::beamLnk()
237 DocLnk doc( *((DocLnk *)lnk) ); 225 DocLnk doc( *((DocLnk *)lnk) );
226 doc.setName(d->docname->text());
227 reject();
238 ir.send( doc, doc.comment() ); 228 ir.send( doc, doc.comment() );
@@ -301,8 +291,12 @@ void LnkProperties::done(int ok)
301 apps.append(exe); 291 apps.append(exe);
292#ifndef QT_NO_COP
302 QCopEnvelope e("QPE/Application/"+exe.local8Bit(), 293 QCopEnvelope e("QPE/Application/"+exe.local8Bit(),
303 "enablePreload()"); 294 "enablePreload()");
295#endif
304 } else { 296 } else {
305 apps.remove(exe); 297 apps.remove(exe);
298#ifndef QT_NO_COP
306 QCopEnvelope e("QPE/Application/"+exe.local8Bit(), 299 QCopEnvelope e("QPE/Application/"+exe.local8Bit(),
307 "quitIfInvisible()"); 300 "quitIfInvisible()");
301#endif
308 } 302 }