summaryrefslogtreecommitdiff
path: root/library/lnkproperties.cpp
Unidiff
Diffstat (limited to 'library/lnkproperties.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/lnkproperties.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp
index 0661423..865f590 100644
--- a/library/lnkproperties.cpp
+++ b/library/lnkproperties.cpp
@@ -81,96 +81,99 @@ LnkProperties::LnkProperties( AppLnk* l, QWidget* parent )
81 d->commentLabel->hide(); 81 d->commentLabel->hide();
82 } else { 82 } else {
83 d->comment->setText( l->comment() ); 83 d->comment->setText( l->comment() );
84 } 84 }
85 85
86 connect(d->beam,SIGNAL(clicked()),this,SLOT(beamLnk())); 86 connect(d->beam,SIGNAL(clicked()),this,SLOT(beamLnk()));
87 if ( lnk->type().contains('/') ) { // A document? (#### better predicate needed) 87 if ( lnk->type().contains('/') ) { // A document? (#### better predicate needed)
88 connect(d->unlink,SIGNAL(clicked()),this,SLOT(unlinkLnk())); 88 connect(d->unlink,SIGNAL(clicked()),this,SLOT(unlinkLnk()));
89 connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk())); 89 connect(d->duplicate,SIGNAL(clicked()),this,SLOT(duplicateLnk()));
90 90
91 d->docname->setReadOnly( FALSE ); 91 d->docname->setReadOnly( FALSE );
92 d->preload->hide(); 92 d->preload->hide();
93 d->rotate->hide(); 93 d->rotate->hide();
94 d->rotateButtons->hide(); 94 d->rotateButtons->hide();
95 d->labelspacer->hide(); 95 d->labelspacer->hide();
96 96
97 // ### THIS MUST GO, FIX WIERD BUG in QLAYOUT 97 // ### THIS MUST GO, FIX WIERD BUG in QLAYOUT
98 d->categoryEdit->kludge(); 98 d->categoryEdit->kludge();
99 99
100 d->categoryEdit->setCategories( lnk->categories(), 100 d->categoryEdit->setCategories( lnk->categories(),
101 "Document View", 101 "Document View",
102 tr("Document View") ); 102 tr("Document View") );
103 setupLocations(); 103 setupLocations();
104 } else { 104 } else {
105 d->unlink->hide(); 105 d->unlink->hide();
106 d->duplicate->hide(); 106 d->duplicate->hide();
107 d->beam->hide(); 107 d->beam->hide();
108 d->hline->hide(); 108 d->hline->hide();
109 d->locationLabel->hide(); 109 d->locationLabel->hide();
110 d->locationCombo->hide(); 110 d->locationCombo->hide();
111 111
112 // Can't edit categories, since the app .desktop files are global, 112 // Can't edit categories, since the app .desktop files are global,
113 // possibly read-only. 113 // possibly read-only.
114 d->categoryEdit->hide(); 114 d->categoryEdit->hide();
115 115
116 d->docname->setReadOnly( TRUE ); 116 d->docname->setReadOnly( TRUE );
117 117
118 if ( l->property("CanFastload") == "0" ) 118 if ( l->property("CanFastload") == "0" )
119 d->preload->hide(); 119 d->preload->hide();
120 if ( !l->property("Rotation"). isEmpty ()) { 120 if ( !l->property("Rotation"). isEmpty ()) {
121 d->rotate->setChecked ( true ); 121 d->rotate->setChecked ( true );
122 //don't use rotate buttons for now (see comment above) 122 //don't use rotate buttons for now (see comment above)
123 //d->rotateButtons->setButton((l->rotation().toInt()%360)/90); 123 //d->rotateButtons->setButton((l->rotation().toInt()%360)/90);
124 } 124 }
125 else { 125 else {
126 d->rotateButtons->setEnabled(false); 126 d->rotateButtons->setEnabled(false);
127 } 127 }
128 128
129 if ( !l->property( "Arguments" ).isEmpty() )
130 d->arguments->setText( l->property( "Arguments" ) );
131
129 Config cfg("Launcher"); 132 Config cfg("Launcher");
130 cfg.setGroup("Preload"); 133 cfg.setGroup("Preload");
131 QStringList apps = cfg.readListEntry("Apps",','); 134 QStringList apps = cfg.readListEntry("Apps",',');
132 d->preload->setChecked( apps.contains(l->exec()) ); 135 d->preload->setChecked( apps.contains(l->exec()) );
133 if ( Global::isBuiltinCommand(lnk->exec()) ) 136 if ( Global::isBuiltinCommand(lnk->exec()) )
134 d->preload->hide(); // builtins are always fast 137 d->preload->hide(); // builtins are always fast
135 138
136 currentLocation = 0; // apps not movable (yet) 139 currentLocation = 0; // apps not movable (yet)
137 } 140 }
138} 141}
139 142
140LnkProperties::~LnkProperties() 143LnkProperties::~LnkProperties()
141{ 144{
142} 145}
143 146
144void LnkProperties::unlinkLnk() 147void LnkProperties::unlinkLnk()
145{ 148{
146 if ( QPEMessageBox::confirmDelete( this, tr("Delete"), lnk->name() ) ) { 149 if ( QPEMessageBox::confirmDelete( this, tr("Delete"), lnk->name() ) ) {
147 lnk->removeFiles(); 150 lnk->removeFiles();
148 if ( QFile::exists(lnk->file()) ) { 151 if ( QFile::exists(lnk->file()) ) {
149 QMessageBox::warning( this, tr("Delete"), tr("File deletion failed.") ); 152 QMessageBox::warning( this, tr("Delete"), tr("File deletion failed.") );
150 } else { 153 } else {
151 reject(); 154 reject();
152 } 155 }
153 } 156 }
154} 157}
155 158
156void LnkProperties::setupLocations() 159void LnkProperties::setupLocations()
157{ 160{
158 QFileInfo fi( lnk->file() ); 161 QFileInfo fi( lnk->file() );
159 fileSize = fi.size(); 162 fileSize = fi.size();
160 StorageInfo storage; 163 StorageInfo storage;
161 const QList<FileSystem> &fs = storage.fileSystems(); 164 const QList<FileSystem> &fs = storage.fileSystems();
162 QListIterator<FileSystem> it ( fs ); 165 QListIterator<FileSystem> it ( fs );
163 QString s; 166 QString s;
164 QString homeDir = getenv("HOME"); 167 QString homeDir = getenv("HOME");
165 QString hardDiskHome; 168 QString hardDiskHome;
166 QString hardDiskPath; 169 QString hardDiskPath;
167 int index = 0; 170 int index = 0;
168 currentLocation = -1; 171 currentLocation = -1;
169 for ( ; it.current(); ++it ) { 172 for ( ; it.current(); ++it ) {
170 // we add 10k to the file size so we are sure we can also save the desktop file 173 // we add 10k to the file size so we are sure we can also save the desktop file
171 if ( (ulong)(*it)->availBlocks() * (ulong)(*it)->blockSize() > (ulong)fileSize + 10000 ) { 174 if ( (ulong)(*it)->availBlocks() * (ulong)(*it)->blockSize() > (ulong)fileSize + 10000 ) {
172 if ( (*it)->isRemovable() || 175 if ( (*it)->isRemovable() ||
173 (*it)->disk() == "/dev/mtdblock1" || 176 (*it)->disk() == "/dev/mtdblock1" ||
174 (*it)->disk() == "/dev/mtdblock/1" || 177 (*it)->disk() == "/dev/mtdblock/1" ||
175 (*it)->disk().left(13) == "/dev/mtdblock" || 178 (*it)->disk().left(13) == "/dev/mtdblock" ||
176 (*it)->disk() == "/dev/mtdblock6" || 179 (*it)->disk() == "/dev/mtdblock6" ||