aboutsummaryrefslogtreecommitdiff
path: root/lumina-open/LFileDialog.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-03-11 11:09:51 -0500
committerKen Moore <moorekou@gmail.com>2016-03-11 11:09:51 -0500
commitcdc5e2e146ac7bbe68731b3090225fc84e3a1b5d (patch)
tree6050ba0e59a072216b5177c14d0e51d08e27530c /lumina-open/LFileDialog.cpp
parentClean up some random gnome icon paths in the lumina-fileinfo mainUI.ui file. (diff)
downloadlumina-cdc5e2e146ac7bbe68731b3090225fc84e3a1b5d.tar.gz
lumina-cdc5e2e146ac7bbe68731b3090225fc84e3a1b5d.tar.bz2
lumina-cdc5e2e146ac7bbe68731b3090225fc84e3a1b5d.zip
Significant update to mime-type handling.
1) Register/use the "inode/directory" mimetype for the default file manager. 2) Register/use the "x-scheme-handler/http[s]" mimetypes for the default web browser Note: Still have not found valid mimetypes for the default terminal/email apps yet - so those still use the alternate lumina settings.
Diffstat (limited to 'lumina-open/LFileDialog.cpp')
-rw-r--r--lumina-open/LFileDialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lumina-open/LFileDialog.cpp b/lumina-open/LFileDialog.cpp
index d35a0fc7..234a48b7 100644
--- a/lumina-open/LFileDialog.cpp
+++ b/lumina-open/LFileDialog.cpp
@@ -33,11 +33,12 @@ LFileDialog::~LFileDialog(){
// ----------
void LFileDialog::setFileInfo(QString filename, QString extension, bool isFile){
//Set the labels for the file
+ qDebug() << "SetFileInfo:" << filename << extension << isFile;
ui->label_file->setText( this->fontMetrics().elidedText( filename, Qt::ElideMiddle, 300 ) );
bool shownetwork = false;
if(isFile){ ui->label_extension->setText( "("+extension+")"); }
else if(extension=="email"){ ui->label_extension->setText( QString(tr("(Email Link)")) ); shownetwork = true; }
- else if(extension=="webbrowser"){ ui->label_extension->setText( QString(tr("(Internet URL)")) ); shownetwork = true; }
+ else if(extension.startsWith("x-scheme-handler/")){ ui->label_extension->setText( QString(tr("(Internet URL - %1)")).arg(extension.section("/",-1)) ); shownetwork = true; }
else{ui->label_extension->setText("("+extension+" link)"); }
fileEXT = extension; //NOTE: this is the mime-type for the file now, not the extension
generateAppList(shownetwork);
@@ -46,7 +47,11 @@ void LFileDialog::setFileInfo(QString filename, QString extension, bool isFile){
//static functions
QString LFileDialog::getDefaultApp(QString extension){
QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath()+"/.lumina");
+ if(extension.contains("/")){
+ return LXDG::findDefaultAppForMime(extension);
+ }else{
return QSettings("LuminaDE", "lumina-open").value("default/"+extension,"").toString();
+ }
}
void LFileDialog::setDefaultApp(QString extension, QString appFile){
bgstack15