summaryrefslogtreecommitdiff
path: root/library
authorsandman <sandman>2002-10-09 23:01:34 (UTC)
committer sandman <sandman>2002-10-09 23:01:34 (UTC)
commitd624bf47913f76c881f28c6498cec4ad3c007a9b (patch) (side-by-side diff)
treef86e449f8f5153580bead802c9c6f73dd76c3a11 /library
parentecd41d0df770747bb07de5fa3e920adb164affbe (diff)
downloadopie-d624bf47913f76c881f28c6498cec4ad3c007a9b.zip
opie-d624bf47913f76c881f28c6498cec4ad3c007a9b.tar.gz
opie-d624bf47913f76c881f28c6498cec4ad3c007a9b.tar.bz2
Opening documents via the document tab now starts the corresponding app
with the right rotation setting. Filemanager/AdvanceFM doesn't work -- need to investigate this further.
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/lnkproperties.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/lnkproperties.cpp b/library/lnkproperties.cpp
index 745ee2c..0b50bae 100644
--- a/library/lnkproperties.cpp
+++ b/library/lnkproperties.cpp
@@ -24,32 +24,33 @@
#include "lnkproperties.h"
#include "lnkproperties.h"
#include "lnkpropertiesbase_p.h"
#include "ir.h"
#include <qpe/qpeapplication.h>
#include <qpe/applnk.h>
#include <qpe/global.h>
#include <qpe/categorywidget.h>
#ifdef QWS
#include <qpe/qcopenvelope_qws.h>
#endif
#include <qpe/filemanager.h>
#include <qpe/config.h>
#include <qpe/storage.h>
#include <qpe/qpemessagebox.h>
+#include <qpe/mimetype.h>
#include <qlineedit.h>
#include <qtoolbutton.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qmessagebox.h>
#include <qsize.h>
#include <qcombobox.h>
#include <qregexp.h>
#include <qbuttongroup.h>
@@ -262,75 +263,80 @@ bool LnkProperties::copyFile( DocLnk &newdoc )
fn = nn;
}
newdoc.setFile( fn + fileExtn );
newdoc.setLinkFile( fn + linkExtn );
// Copy file
FileManager fm;
if ( !fm.copyFile( *lnk, newdoc ) )
return FALSE;
return TRUE;
}
void LnkProperties::done(int ok)
{
if ( ok ) {
bool changed=FALSE;
+ bool reloadMime=FALSE;
+
if ( lnk->name() != d->docname->text() ) {
lnk->setName(d->docname->text());
changed=TRUE;
}
if ( d->categoryEdit->isVisible() ) {
QArray<int> tmp = d->categoryEdit->newCategories();
if ( lnk->categories() != tmp ) {
lnk->setCategories( tmp );
changed = TRUE;
}
}
if ( !d->rotate->isHidden()) {
QString newrot;
if ( d->rotate->isChecked() ) {
int rot=0;
for(; rot<4; rot++) {
if (d->rotateButtons->find(rot)->isOn())
break;
}
newrot = QString::number((rot*90)%360);
}
if ( newrot != lnk->rotation() ) {
lnk-> setRotation(newrot);
changed = TRUE;
+ reloadMime = TRUE;
}
}
if ( d->preload->isHidden() && d->locationCombo->currentItem() != currentLocation ) {
moveLnk();
} else if ( changed ) {
lnk->writeLink();
}
if ( !d->preload->isHidden() ) {
Config cfg("Launcher");
cfg.setGroup("Preload");
QStringList apps = cfg.readListEntry("Apps",',');
QString exe = lnk->exec();
if ( apps.contains(exe) != d->preload->isChecked() ) {
if ( d->preload->isChecked() ) {
apps.append(exe);
#ifndef QT_NO_COP
QCopEnvelope e("QPE/Application/"+exe.local8Bit(),
"enablePreload()");
#endif
} else {
apps.remove(exe);
#ifndef QT_NO_COP
QCopEnvelope e("QPE/Application/"+exe.local8Bit(),
"quitIfInvisible()");
#endif
}
cfg.writeEntry("Apps",apps,',');
}
}
+ if ( reloadMime )
+ MimeType::updateApplications ( );
}
QDialog::done( ok );
}