aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-open
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/core/lumina-open')
-rw-r--r--src-qt5/core/lumina-open/LFileDialog.cpp35
-rw-r--r--src-qt5/core/lumina-open/i18n/lumina-open_ru.ts86
-rw-r--r--src-qt5/core/lumina-open/i18n/lumina-open_sv.ts90
-rw-r--r--src-qt5/core/lumina-open/main.cpp22
4 files changed, 118 insertions, 115 deletions
diff --git a/src-qt5/core/lumina-open/LFileDialog.cpp b/src-qt5/core/lumina-open/LFileDialog.cpp
index fbcf007f..a0fef17c 100644
--- a/src-qt5/core/lumina-open/LFileDialog.cpp
+++ b/src-qt5/core/lumina-open/LFileDialog.cpp
@@ -158,17 +158,21 @@ void LFileDialog::updateUI(){
void LFileDialog::generateAppList(bool shownetwork){
//Now load the preferred applications
+ XDGDesktopList applist;
+ applist.updateList();
PREFAPPS = getPreferredApplications();
+ //qDebug() << "Preferred Apps:" << PREFAPPS;
ui->combo_rec->clear();
//Now get the application mimetype for the file extension (if available)
QStringList mimetypes = LXDG::findAppMimeForFile(filePath, true).split("::::"); //use all mimetypes
+ mimetypes.removeDuplicates();
//Now add all the detected applications
- QHash< QString, QList<XDGDesktop> > hash = LXDG::sortDesktopCats( LXDG::systemDesktopFiles(false,true) );
+ QHash< QString, QList<XDGDesktop*> > hash = LXDG::sortDesktopCats( applist.apps(false,true) );
QStringList cat = hash.keys();
cat.sort(); //sort alphabetically
ui->combo_apps->clear();
for(int c=0; c<cat.length(); c++){
- QList<XDGDesktop> app = hash[cat[c]];
+ QList<XDGDesktop*> app = hash[cat[c]];
if(app.length()<1){ continue; }
if(ui->combo_apps->count() >1){ ui->combo_apps->insertSeparator(ui->combo_apps->count()); }
ui->combo_apps->addItem(translateCat(cat[c]));
@@ -176,17 +180,19 @@ void LFileDialog::generateAppList(bool shownetwork){
for(int a=0; a<app.length(); a++){
if(shownetwork && (cat[c].toLower()=="network" || cat[c].toLower()=="utility") ){
//Need to show preferred internet applications - look for ones that handle URL's
- if(app[a].exec.contains("%u") || app[a].exec.contains("%U")){
- PREFAPPS << app[a].filePath;
+ if(app[a]->exec.contains("%u") || app[a]->exec.contains("%U")){
+ //qDebug() << "Add to Preferred Apps:" << app[a]->filePath;
+ PREFAPPS << app[a]->filePath;
}
}
- ui->combo_apps->addItem(LXDG::findIcon(app[a].icon, "application-x-desktop"), app[a].name, app[a].filePath);
+ ui->combo_apps->addItem(LXDG::findIcon(app[a]->icon, "application-x-desktop"), app[a]->name, app[a]->filePath);
//Check to see if this app matches the mime type
if(!mimetypes.isEmpty()){
- QStringList tmp = mimetypes; tmp << app[a].mimeList;
+ QStringList tmp = mimetypes; tmp << app[a]->mimeList;
if(tmp.removeDuplicates() > 0 ){
// also put this app in the preferred list
- PREFAPPS.append(app[a].filePath);
+ //qDebug() << "Mimetype match:" << mimetypes << app[a]->mimeList;
+ PREFAPPS.append(app[a]->filePath);
//If this is the first preferred app found - select this app initially
if(ui->combo_apps->currentIndex()<=0){ ui->combo_apps->setCurrentIndex(ui->combo_apps->count()-1); }
}
@@ -197,9 +203,8 @@ void LFileDialog::generateAppList(bool shownetwork){
//Now add all the preferred applications
PREFAPPS.removeDuplicates();
for(int i=0; i<PREFAPPS.length(); i++){
- bool ok = false;
- XDGDesktop dFile = LXDG::loadDesktopFile(PREFAPPS[i], ok);
- if( LXDG::checkValidity(dFile) && ok ){
+ XDGDesktop dFile(PREFAPPS[i]);
+ if( dFile.isValid() ){
ui->combo_rec->addItem( LXDG::findIcon(dFile.icon, "application-x-desktop"), dFile.name);
if(i==0){ ui->combo_rec->setCurrentIndex(0); } //make sure the first item is selected
}else{
@@ -242,19 +247,17 @@ void LFileDialog::on_tool_ok_clicked(){
appExec = ui->line_bin->text();
}else if(ui->radio_rec->isChecked()){
//application selected
- bool ok = false;
- XDGDesktop app = LXDG::loadDesktopFile(PREFAPPS[ui->combo_rec->currentIndex()], ok);
+ XDGDesktop app(PREFAPPS[ui->combo_rec->currentIndex()]);
//Set the output variables
- appExec = LXDG::getDesktopExec(app);
+ appExec = app.getDesktopExec();
appPath = app.path;
appFile = app.filePath;
setPreferredApplication(app.filePath); //bump this to the top of the preferred list for next time
}else{
//application selected
- bool ok = false;
- XDGDesktop app = LXDG::loadDesktopFile(ui->combo_apps->currentData().toString(), ok);
+ XDGDesktop app(ui->combo_apps->currentData().toString());
//Set the output variables
- appExec = LXDG::getDesktopExec(app);
+ appExec = app.getDesktopExec();
appPath = app.path;
appFile = app.filePath;
setPreferredApplication(app.filePath); //save this app to this extension as a recommendation
diff --git a/src-qt5/core/lumina-open/i18n/lumina-open_ru.ts b/src-qt5/core/lumina-open/i18n/lumina-open_ru.ts
index 1a1f9f18..f27df3a4 100644
--- a/src-qt5/core/lumina-open/i18n/lumina-open_ru.ts
+++ b/src-qt5/core/lumina-open/i18n/lumina-open_ru.ts
@@ -4,132 +4,132 @@
<context>
<name>LFileDialog</name>
<message>
- <location filename="../LFileDialog.ui" line="14"/>
+ <location filename="../LFileDialog.ui" line="14"></location>
<source>Open With...</source>
<translation>Открыть с помощью...</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="68"/>
+ <location filename="../LFileDialog.ui" line="68"></location>
<source>Preferred</source>
<translation>Предпочтительный</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="75"/>
+ <location filename="../LFileDialog.ui" line="75"></location>
<source>Available</source>
<translation>Доступно</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="82"/>
+ <location filename="../LFileDialog.ui" line="82"></location>
<source>Custom</source>
<translation>Пользовательские</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="131"/>
+ <location filename="../LFileDialog.ui" line="131"></location>
<source>Binary Location</source>
<translation>Расположение Бинарного Приложения</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="138"/>
+ <location filename="../LFileDialog.ui" line="138"></location>
<source>Find</source>
<translation>Найти</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="199"/>
+ <location filename="../LFileDialog.ui" line="199"></location>
<source>Set this application as the default </source>
<translation>Использовать это приложение по умолчанию </translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="221"/>
+ <location filename="../LFileDialog.ui" line="221"></location>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="235"/>
+ <location filename="../LFileDialog.ui" line="235"></location>
<source>Cancel</source>
<translation>Отмена</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="40"/>
+ <location filename="../LFileDialog.cpp" line="40"></location>
<source>(Email Link)</source>
<translation>(Email адрес)</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="41"/>
+ <location filename="../LFileDialog.cpp" line="41"></location>
<source>(Internet URL - %1)</source>
<translation>(Интернет URL - %1)</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="114"/>
+ <location filename="../LFileDialog.cpp" line="114"></location>
<source>Audio</source>
<translation>Звук</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="115"/>
+ <location filename="../LFileDialog.cpp" line="115"></location>
<source>Video</source>
<translation>Видео</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="116"/>
+ <location filename="../LFileDialog.cpp" line="116"></location>
<source>Multimedia</source>
<translation>Мультимедиа</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="117"/>
+ <location filename="../LFileDialog.cpp" line="117"></location>
<source>Development</source>
<translation>Разработка</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="118"/>
+ <location filename="../LFileDialog.cpp" line="118"></location>
<source>Education</source>
<translation>Образование</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="119"/>
+ <location filename="../LFileDialog.cpp" line="119"></location>
<source>Game</source>
<translation>Игры</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="120"/>
+ <location filename="../LFileDialog.cpp" line="120"></location>
<source>Graphics</source>
<translation>Графика</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="121"/>
+ <location filename="../LFileDialog.cpp" line="121"></location>
<source>Network</source>
<translation>Сети</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="122"/>
+ <location filename="../LFileDialog.cpp" line="122"></location>
<source>Office</source>
<translation>Офис</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="123"/>
+ <location filename="../LFileDialog.cpp" line="123"></location>
<source>Science</source>
<translation>Наука</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="124"/>
+ <location filename="../LFileDialog.cpp" line="124"></location>
<source>Settings</source>
<translation>Настройки</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="125"/>
+ <location filename="../LFileDialog.cpp" line="125"></location>
<source>System</source>
<translation>Система</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="126"/>
+ <location filename="../LFileDialog.cpp" line="126"></location>
<source>Utilities</source>
<translation>Инструменты</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="127"/>
+ <location filename="../LFileDialog.cpp" line="127"></location>
<source>Other</source>
<translation>Разное</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="271"/>
+ <location filename="../LFileDialog.cpp" line="271"></location>
<source>Find Application Binary</source>
<translation>Найти Бинарное Приложение</translation>
</message>
@@ -137,69 +137,69 @@
<context>
<name>QObject</name>
<message>
- <location filename="../main.cpp" line="51"/>
+ <location filename="../main.cpp" line="51"></location>
<source>File Error</source>
<translation>Ошибка Файла</translation>
</message>
<message>
- <location filename="../main.cpp" line="187"/>
- <location filename="../main.cpp" line="193"/>
+ <location filename="../main.cpp" line="187"></location>
+ <location filename="../main.cpp" line="193"></location>
<source>Audio Volume %1%</source>
<translation>Громкость %1%</translation>
</message>
<message>
- <location filename="../main.cpp" line="201"/>
- <location filename="../main.cpp" line="210"/>
+ <location filename="../main.cpp" line="201"></location>
+ <location filename="../main.cpp" line="210"></location>
<source>Screen Brightness %1%</source>
<translation>Яркость Экрана %1%</translation>
</message>
<message>
- <location filename="../main.cpp" line="242"/>
+ <location filename="../main.cpp" line="242"></location>
<source>Invalid file or URL: %1</source>
<translation>Неверный файл или URL-адрес: %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="264"/>
+ <location filename="../main.cpp" line="264"></location>
<source>File could not be opened: %1</source>
<translation>Файл не может быть открыт: %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="273"/>
+ <location filename="../main.cpp" line="273"></location>
<source>Application shortcut is missing the launching information (malformed shortcut): %1</source>
<translation>В ярлыке приложения отсутствует информация для запуска (неверный формат ярлыка): %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="284"/>
+ <location filename="../main.cpp" line="284"></location>
<source>URL shortcut is missing the URL: %1</source>
<translation>В ярлыке отсутствует URL-адрес: %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="295"/>
+ <location filename="../main.cpp" line="295"></location>
<source>Directory shortcut is missing the path to the directory: %1</source>
<translation>В ярлыке отсутствует путь к папке: %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="300"/>
+ <location filename="../main.cpp" line="300"></location>
<source>Unknown type of shortcut : %1</source>
<translation>Неизвестный тип ярлыка: %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="362"/>
+ <location filename="../main.cpp" line="362"></location>
<source>Binary Missing</source>
<translation>Приложение отсутствует</translation>
</message>
<message>
- <location filename="../main.cpp" line="362"/>
- <source>Could not find &quot;%1&quot;. Please ensure it is installed first.</source>
- <translation>Не найден &quot;%1&quot;. Пожалуйста, убедитесь, что он установлен в первую очередь. </translation>
+ <location filename="../main.cpp" line="362"></location>
+ <source>Could not find "%1". Please ensure it is installed first.</source>
+ <translation>Не найден "%1". Пожалуйста, убедитесь, что он установлен в первую очередь.</translation>
</message>
<message>
- <location filename="../main.cpp" line="412"/>
+ <location filename="../main.cpp" line="412"></location>
<source>Application Error</source>
<translation>Ошибка Приложения</translation>
</message>
<message>
- <location filename="../main.cpp" line="412"/>
+ <location filename="../main.cpp" line="412"></location>
<source>The following application experienced an error and needed to close:</source>
<translation>Следующее приложение вызвало ошибку и должно быть закрыто:</translation>
</message>
diff --git a/src-qt5/core/lumina-open/i18n/lumina-open_sv.ts b/src-qt5/core/lumina-open/i18n/lumina-open_sv.ts
index 8325525c..2bc08ed2 100644
--- a/src-qt5/core/lumina-open/i18n/lumina-open_sv.ts
+++ b/src-qt5/core/lumina-open/i18n/lumina-open_sv.ts
@@ -1,135 +1,135 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE TS>
<TS version="2.1" language="sv">
<context>
<name>LFileDialog</name>
<message>
- <location filename="../LFileDialog.ui" line="14"/>
+ <location filename="../LFileDialog.ui" line="14"></location>
<source>Open With...</source>
<translation>Öppna med...</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="68"/>
+ <location filename="../LFileDialog.ui" line="68"></location>
<source>Preferred</source>
<translation>Föredras</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="75"/>
+ <location filename="../LFileDialog.ui" line="75"></location>
<source>Available</source>
<translation>Tillgänglig</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="82"/>
+ <location filename="../LFileDialog.ui" line="82"></location>
<source>Custom</source>
<translation>Anpassad</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="131"/>
+ <location filename="../LFileDialog.ui" line="131"></location>
<source>Binary Location</source>
<translation>Binärens Plats</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="138"/>
+ <location filename="../LFileDialog.ui" line="138"></location>
<source>Find</source>
<translation>Hitta</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="199"/>
+ <location filename="../LFileDialog.ui" line="199"></location>
<source>Set this application as the default </source>
<translation>Sätt detta program som standard</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="221"/>
+ <location filename="../LFileDialog.ui" line="221"></location>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
- <location filename="../LFileDialog.ui" line="235"/>
+ <location filename="../LFileDialog.ui" line="235"></location>
<source>Cancel</source>
<translation>Avbryt</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="40"/>
+ <location filename="../LFileDialog.cpp" line="40"></location>
<source>(Email Link)</source>
<translation>(Email Länk)</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="41"/>
+ <location filename="../LFileDialog.cpp" line="41"></location>
<source>(Internet URL - %1)</source>
<translation>(Internet URL - %1)</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="114"/>
+ <location filename="../LFileDialog.cpp" line="114"></location>
<source>Audio</source>
<translation>Ljud</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="115"/>
+ <location filename="../LFileDialog.cpp" line="115"></location>
<source>Video</source>
<translation>Video</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="116"/>
+ <location filename="../LFileDialog.cpp" line="116"></location>
<source>Multimedia</source>
<translation>Multimedia</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="117"/>
+ <location filename="../LFileDialog.cpp" line="117"></location>
<source>Development</source>
<translation>Utveckling</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="118"/>
+ <location filename="../LFileDialog.cpp" line="118"></location>
<source>Education</source>
<translation>Utbildning</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="119"/>
+ <location filename="../LFileDialog.cpp" line="119"></location>
<source>Game</source>
<translation>Spel</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="120"/>
+ <location filename="../LFileDialog.cpp" line="120"></location>
<source>Graphics</source>
<translation>Grafik</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="121"/>
+ <location filename="../LFileDialog.cpp" line="121"></location>
<source>Network</source>
<translation>Nätverk</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="122"/>
+ <location filename="../LFileDialog.cpp" line="122"></location>
<source>Office</source>
<translation>Kontorsprogram</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="123"/>
+ <location filename="../LFileDialog.cpp" line="123"></location>
<source>Science</source>
<translation>Vetenskap</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="124"/>
+ <location filename="../LFileDialog.cpp" line="124"></location>
<source>Settings</source>
<translation>Inställningar</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="125"/>
+ <location filename="../LFileDialog.cpp" line="125"></location>
<source>System</source>
<translation>System</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="126"/>
+ <location filename="../LFileDialog.cpp" line="126"></location>
<source>Utilities</source>
<translation>Verktyg</translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="127"/>
+ <location filename="../LFileDialog.cpp" line="127"></location>
<source>Other</source>
<translation>Annat </translation>
</message>
<message>
- <location filename="../LFileDialog.cpp" line="271"/>
+ <location filename="../LFileDialog.cpp" line="271"></location>
<source>Find Application Binary</source>
<translation>Hitta Programmets Binär </translation>
</message>
@@ -137,69 +137,69 @@
<context>
<name>QObject</name>
<message>
- <location filename="../main.cpp" line="51"/>
+ <location filename="../main.cpp" line="51"></location>
<source>File Error</source>
<translation>Filfel</translation>
</message>
<message>
- <location filename="../main.cpp" line="187"/>
- <location filename="../main.cpp" line="193"/>
+ <location filename="../main.cpp" line="187"></location>
+ <location filename="../main.cpp" line="193"></location>
<source>Audio Volume %1%</source>
<translation>Ljudvolym %1%</translation>
</message>
<message>
- <location filename="../main.cpp" line="201"/>
- <location filename="../main.cpp" line="210"/>
+ <location filename="../main.cpp" line="201"></location>
+ <location filename="../main.cpp" line="210"></location>
<source>Screen Brightness %1%</source>
<translation>Skärmljusstyrka %1%</translation>
</message>
<message>
- <location filename="../main.cpp" line="242"/>
+ <location filename="../main.cpp" line="242"></location>
<source>Invalid file or URL: %1</source>
<translation>Ogiltig fil eller URL %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="264"/>
+ <location filename="../main.cpp" line="264"></location>
<source>File could not be opened: %1</source>
<translation>Filen kunde inte öppnas: %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="273"/>
+ <location filename="../main.cpp" line="273"></location>
<source>Application shortcut is missing the launching information (malformed shortcut): %1</source>
<translation>Program genväg saknar startinformation (missbildad genväg): %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="284"/>
+ <location filename="../main.cpp" line="284"></location>
<source>URL shortcut is missing the URL: %1</source>
<translation>URL genväg saknas URL: %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="295"/>
+ <location filename="../main.cpp" line="295"></location>
<source>Directory shortcut is missing the path to the directory: %1</source>
<translation>Genvägen till katalogen saknar sökvägen till katalogen :%1</translation>
</message>
<message>
- <location filename="../main.cpp" line="300"/>
+ <location filename="../main.cpp" line="300"></location>
<source>Unknown type of shortcut : %1</source>
<translation>Okänd typ av genväg: %1</translation>
</message>
<message>
- <location filename="../main.cpp" line="362"/>
+ <location filename="../main.cpp" line="362"></location>
<source>Binary Missing</source>
- <translation type="unfinished"></translation>
+ <translation>Binär saknas</translation>
</message>
<message>
- <location filename="../main.cpp" line="362"/>
- <source>Could not find &quot;%1&quot;. Please ensure it is installed first.</source>
- <translation type="unfinished"></translation>
+ <location filename="../main.cpp" line="362"></location>
+ <source>Could not find "%1". Please ensure it is installed first.</source>
+ <translation>Kunde inte hitta "%1". Se till att du har detta programmet installerat först.</translation>
</message>
<message>
- <location filename="../main.cpp" line="412"/>
+ <location filename="../main.cpp" line="412"></location>
<source>Application Error</source>
<translation>Program fel</translation>
</message>
<message>
- <location filename="../main.cpp" line="412"/>
+ <location filename="../main.cpp" line="412"></location>
<source>The following application experienced an error and needed to close:</source>
<translation>Följande program upplevde ett fel och behövde stängas:</translation>
</message>
diff --git a/src-qt5/core/lumina-open/main.cpp b/src-qt5/core/lumina-open/main.cpp
index 756bef25..68d2575b 100644
--- a/src-qt5/core/lumina-open/main.cpp
+++ b/src-qt5/core/lumina-open/main.cpp
@@ -80,17 +80,19 @@ void showOSD(int argc, char **argv, QString message){
}
void LaunchAutoStart(){
- QList<XDGDesktop> xdgapps = LXDG::findAutoStartFiles();
+ QList<XDGDesktop*> xdgapps = LXDG::findAutoStartFiles();
for(int i=0; i<xdgapps.length(); i++){
//Generate command and clean up any stray "Exec" field codes (should not be any here)
- QString cmd = LXDG::getDesktopExec(xdgapps[i]);
+ QString cmd = xdgapps[i]->getDesktopExec();
if(cmd.contains("%")){cmd = cmd.remove("%U").remove("%u").remove("%F").remove("%f").remove("%i").remove("%c").remove("%k").simplified(); }
//Now run the command
if(!cmd.isEmpty()){
- qDebug() << " - Auto-Starting File:" << xdgapps[i].filePath;
+ qDebug() << " - Auto-Starting File:" << xdgapps[i]->filePath;
QProcess::startDetached(cmd);
}
}
+ //make sure we clean up all the xdgapps structures
+ for(int i=0; i<xdgapps.length(); i++){ xdgapps[i]->deleteLater(); }
}
QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QString& path, bool showDLG=false){
@@ -109,11 +111,10 @@ QString cmdFromUser(int argc, char **argv, QString inFile, QString extension, QS
}else{ defApp = LFileDialog::getDefaultApp(extension); }
//qDebug() << "extension:" << extension << "defApp:" << defApp;
if( !defApp.isEmpty() && !showDLG ){
- bool ok = false;
if(defApp.endsWith(".desktop")){
- XDGDesktop DF = LXDG::loadDesktopFile(defApp, ok);
- if(ok){
- QString exec = LXDG::getDesktopExec(DF);
+ XDGDesktop DF(defApp);
+ if(DF.isValid()){
+ QString exec = DF.getDesktopExec();
if(!exec.isEmpty()){
qDebug() << "[lumina-open] Using default application:" << DF.name << "File:" << inFile;
if(!DF.path.isEmpty()){ path = DF.path; }
@@ -258,15 +259,14 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat
QString cmd;
bool useInputFile = false;
if(extension=="desktop" && !showDLG){
- bool ok = false;
- XDGDesktop DF = LXDG::loadDesktopFile(inFile, ok);
- if(!ok){
+ XDGDesktop DF(inFile);
+ if(!DF.isValid()){
ShowErrorDialog( argc, argv, QString(QObject::tr("File could not be opened: %1")).arg(inFile) );
}
switch(DF.type){
case XDGDesktop::APP:
if(!DF.exec.isEmpty()){
- cmd = LXDG::getDesktopExec(DF,ActionID);
+ cmd = DF.getDesktopExec(ActionID);
if(!DF.path.isEmpty()){ path = DF.path; }
watch = DF.startupNotify || !DF.filePath.contains("/xdg/autostart/");
}else{
bgstack15