WSL/SLF GitLab Repository

Commit c063dfb7 authored by Mathias Bavay's avatar Mathias Bavay
Browse files
parents 783f157e 81f89cf7
......@@ -8,7 +8,9 @@ Welcome to Inishell, a flexible Graphical User Interface (GUI) for simulation so
Inishell is open source under the GNU GPL3 license and is shipped as the GUI for various numerical modelling software packages to configure and run the simulations intuitively.
Inishell loads XML files containing a semantic description of the models' parameters and dynamically builds a GUI upon this information.
Hence, for the end user it offers a graphical user interface for provided modeling software which is tailored to rapid development and therefore hopefully never outdated. For the developer on the other hand, it offers the possibility to very easily set up a GUI for their application and keep it synchronized with the evolving models. Deploying a new feature in the GUI is then as easy as editing an XML text file and shipping this updated version to the user.
Hence, for the end user it offers a graphical user interface for provided modeling software which is tailored to rapid development and therefore hopefully never outdated. For the developer on the other hand, it offers the possibility to very easily set up a GUI for their application and keep it synchronized with the evolving models. Deploying a new feature in the GUI is then as easy as editing an XML text file and shipping this updated version to the user.
You can find more details in the following paper: Bavay, M., Reisecker, M., Egger, T., and Korhammer, D.: *Inishell 2.0: semantically driven automatic GUI generation for scientific models*, Geosci. Model Dev., **15**, 365–378, https://doi.org/10.5194/gmd-15-365-2022, 2022.
- For help concerning the installation of Inishell as well as general information please visit Inishell's project page at https://gitlabext.wsl.ch/snow-models/inishell - especially the wiki pages at https://gitlabext.wsl.ch/snow-models/inishell/-/wikis/home
- Once Inishell is running, it offers an extensive built-in help browser for both end users and developers.
......
......@@ -83,6 +83,18 @@ https://models.slf.ch/p/alpine3d
<section name="Input"/>
<reference name="GRID2D_IN"/>
<reference name="DEMPLUGINS"/>
<parameter key="SLOPE_ALGORITHM" type="alternative" optional="true">
<option value="HICK"/>
<option value="FLEMING"/>
<option value="CORRIPIO"/>
<option value="D8"/>
<help>How should the slopes be computed from the DEM? (see &lt;a href="https://models.slf.ch/docserver/meteoio/html/classmio_1_1DEMObject.html#a3c1b55919acd8d2177960f72f8d6224a"&gt;MeteoIO's DEM class&lt;/a&gt;, default CORRIPIO)</help>
</parameter>
<parameter key="COMPUTE_IN_LOCAL_COORDS" type="alternative" optional="true">
<option value="TRUE"/>
<option value="FALSE"/>
<help>Setup a local coordinate system to perform all computations? Default: false</help>
</parameter>
<reference name="LANDUSEPLUGINS"/>
<reference name="GLACIERS_IN"/>
<reference name="POI"/>
......
......@@ -35,9 +35,8 @@ https://models.slf.ch/p/snowpack
<option value="TRUE">
<parameter key="Terrain_Radiation_Method" type="alternative" default="SIMPLE" section="EBalance">
<reference name="TERRAIN_SIMPLE"/>
<reference name="TERRAIN_FULL"/>
<reference name="TERRAIN_HELBIG"/>
<reference name="TERRAIN_PETSC"/>
<reference name="TERRAIN_COMPLEX"/>
<help>Select how the radiation reflected by the terrain will be computed</help>
</parameter>
</option>
......@@ -51,27 +50,6 @@ https://models.slf.ch/p/snowpack
</option>
</parametergroup>
<parametergroup name="TERRAIN_FULL">
<option value="FULL">
<parameter key="itEps_SW" type="number" format="decimal" precision="2" default="0.4" min="0">
<help>stopping tolerance/iteration error for shortwave radiation (default: 0.4). Make it larger to stop the iteration earlier, i.e. less terrain reflections are included –> with 10 % (0.1) a good accuracy is obtained.</help>
</parameter>
<parameter key="itEps1_SW" type="number" format="decimal" precision="2" default="0.1" min="0">
<help>stopping tolerance/iteration error for shortwave radiation (default: 0.1). Make it lower to stop the iteration earlier, i.e. less terrain reflections are included</help>
</parameter>
<parameter key="itEps_LW" type="number" format="decimal" precision="2" default="0.1" min="0">
<help>stopping tolerance/iteration error for longwave radiation (default: 0.4). Note that two stopping critera are used</help>
</parameter>
<parameter key="sw_radius" type="number" format="integer+" default="3000" unit="m">
<help>the distance radius (in m) around each grid cell until which terrain reflection is taken into account (default: 3000)</help>
</parameter>
<parameter key="lw_radius" type="number" format="integer+" default="3000" unit="m">
<help>the distance radius (in m) around each grid cell until which longwave emission is taken into account (default: 3000)</help>
</parameter>
<help>a parallelized implementation of a radiosity algorithm, see &lt;a href="https://models.slf.ch/docserver/alpine3d/html/classTerrainRadiation.html"&gt;TerrainRadiation&lt;/a&gt;</help>
</option>
</parametergroup>
<parametergroup name="TERRAIN_HELBIG">
<option value="HELBIG">
<parameter key="itEps_SW" type="number" format="decimal" precision="2" default="0.4" min="0">
......@@ -97,36 +75,58 @@ https://models.slf.ch/p/snowpack
<option value="FALSE"/>
<help>Progressive Refinement iteration is used; but you can enable storing the view factors in memory (in case of sufficient memory capacity –> faster terrain radiation computation)</help>
</parameter>
<parameter key="WRITE_SKY_VIEW_FACTOR" type="alternative" optional="true">
<option value="TRUE">
<parameter key="VF_FILE" type="file" mode="output" optional="false">
<help>file to write the view factors to</help>
</parameter>
<parameter key="TVFAREA" type="file" mode="output" optional="false">
<help>file to write the terrain view factors to</help>
</parameter>
</option>
<option value="FALSE"/>
<help>Write the computed view factors to a file for (much) faster retrieval for new simulations (default: false)</help>
</parameter>
<parameter key="VF_FILE" type="file" mode="input" optional="true">
<help>file to read the pre-computed view factors from</help>
</parameter>
<parameter key="TVFAREA" type="file" mode="input" optional="true">
<help>file to read the pre-computed terrain view factors from</help>
</parameter>
<help>the original radiosity implementation, not parallelized, see &lt;a href="https://models.slf.ch/docserver/alpine3d/html/classTerrainRadiationHelbig.html"&gt;TerrainRadiationHelbig&lt;/a&gt;</help>
</option>
</parametergroup>
<parametergroup name="TERRAIN_PETSC">
<option value="PETSC">
<parameter key="itEps_SW" type="number" format="decimal" precision="2" default="0.4" min="0">
<help>stopping tolerance/iteration error for shortwave radiation (default: 0.4). Make it larger to stop the iteration earlier, i.e. less terrain reflections are included –> with 10 % (0.1) a good accuracy is obtained.</help>
</parameter>
<parameter key="itEps1_SW" type="number" format="decimal" precision="2" default="0.1" min="0">
<help>stopping tolerance/iteration error for shortwave radiation (default: 0.1). Make it lower to stop the iteration earlier, i.e. less terrain reflections are included</help>
</parameter>
<parameter key="itEps_LW" type="number" format="decimal" precision="2" default="0.1" min="0">
<help>stopping tolerance/iteration error for longwave radiation (default: 0.4). Note that two stopping critera are used</help>
</parameter>
<parameter key="sw_radius" type="number" format="integer+" default="3000" unit="m">
<help>the distance radius (in m) around each grid cell until which terrain reflection is taken into account (default: 3000)</help>
</parameter>
<parameter key="lw_radius" type="number" format="integer+" default="3000" unit="m">
<help>the distance radius (in m) around each grid cell until which longwave emission is taken into account (default: 3000)</help>
<parametergroup name="TERRAIN_COMPLEX">
<option value="COMPLEX">
<parameter key="COMPLEX_ANISOTROPY" type="alternative" optional="true">
<option value="TRUE"/>
<option value="FALSE"/>
<help>Whether a snow BRDF should be included. False means isotropic scattering (default: false)</help>
</parameter>
<parameter key="sub_crit" type="number" format="decimal" precision="2" default="0.4" min="0">
<help>substructuring threshold (in %) of the patches in the view factor computation (default: 0.4). Note that mccluney(1994) proposes 0.1, i.e. for accurate view factors / radiation exchange computations a threshold of least 0.1 should be used.</help>
<parameter key="COMPLEX_ANISOTROPY" type="alternative" optional="true">
<option value="TRUE"/>
<option value="FALSE"/>
<help>Whether multiple scattering in the terrain should be taken into account (default: false)</help>
</parameter>
<parameter key="COMPLEX_WRITE_VIEWLIST" type="alternative" optional="true">
<option value="TRUE">
<parameter key="COMPLEX_VIEWLISTFILE" type="file" mode="input" optional="false">
<help>file to write the view factors to</help>
</parameter>
</option>
<option value="FALSE"/>
<help>Whether the initialization stuff should be written to file (in the "ouput" sub-directory) (default: true)</help>
</parameter>
<parameter key="vf_in_ram" type="alternative" default="TRUE">
<parameter key="COMPLEX_READ_VIEWLIST" type="alternative" optional="true">
<option value="TRUE"/>
<option value="FALSE"/>
<help>Progressive Refinement iteration is used; but you can enable storing the view factors in memory (in case of sufficient memory capacity –> faster terrain radiation computation)</help>
<help>Whether an existing initialization file should be read in; bypassing the initialization (default: false)</help>
</parameter>
<parameter key="PVPFILE" type="file" mode="input" optional="true">
<help>file to define solar panels</help>
</parameter>
<help>&lt;font color='#ff0000'&gt;This method relies on special libraries and compilation flags!! Use it at your own risk!&lt;/font&gt;</help>
<help>radiative transfer of SW radiation in snow-covered terrain according to (von Rütte, F., Kahl, A., Rohrer, J., Lehning, M. &lt;i&gt;"How forward-scattering snow and terrain change the Alpine radiation balance with application to solar panels"&lt;/i&gt;, Journal of Geophysical Research: Atmospheres, 126, e2020JD034333, (2021), &lt;a href="https://doi.org/10.1029/2020JD034333"&gt;doi.org/10.1029/2020JD034333&lt;/a&gt;</help>
</option>
</parametergroup>
......
......@@ -55,6 +55,15 @@ INIshell include file for gridded input / output plugin definitions
<parameter key="SOIL_TEMPERATURE_DEPTHS" type="text" optional="true">
<help>list of depths (in m) where to extract grids of soil temperatures</help>
</parameter>
<parameter key="SNOW_TEMPERATURE_DEPTH" type="number" format="decimal" precision="3" min="0" unit="m" optional="true">
<help>depth (in m) where to extract grids of snow temperatures (if the snow is not deep enough for the chosen depth, the pixel gets assigned nodata)</help>
</parameter>
<parameter key="SNOW_AVG_TEMPERATURE_DEPTH" type="number" format="decimal" precision="3" min="0" unit="m" optional="true">
<help>extract grids of average snow temperatures for the top &lt;i&gt;x&lt;/i&gt; m (if the snow is not deep enough for the chosen depth, the pixel will be assigned the average temperature of the whole snow pack)</help>
</parameter>
<parameter key="SNOW_AVG_DENSITY_DEPTH" type="number" format="decimal" precision="3" min="0" unit="m" optional="true">
<help>extract grids of average snow density for the top &lt;i&gt;x&lt;/i&gt; m (if the snow is not deep enough for the chosen depth, the pixel will be assigned the average density of the whole snow pack)</help>
</parameter>
</option>
<option value="FALSE"/>
<help>Output distributed grids of certain parameters?</help>
......
......@@ -130,7 +130,7 @@ INIshell include file for MeteoIO generators
<parametergroup name="GENERATOR_CLEARSKY_LW">
<option value="CLEARSKY_LW" type="choice">
<parameter key="%::ARG#::TYPE" label="Model:" type="alternative">
<parameter key="%::ARG#::TYPE" label="Model:" type="alternative" optional="false">
<option value="Brutsaert"/>
<option value="Clark"/>
<option value="Dilley"/>
......@@ -146,12 +146,20 @@ INIshell include file for MeteoIO generators
<parametergroup name="GENERATOR_ALLSKY_LW">
<option value="ALLSKY_LW">
<parameter key="%::ARG#::TYPE" label="Model:" type="alternative">
<parameter key="%::ARG#::TYPE" label="Model:" type="alternative" optional="false">
<option value="Carmona"/>
<option value="Crawford"/>
<option value="Konzelmann"/>
<option value="Lhomme"/>
<option value="Omstedt"/>
<option value="Unsworth"/>
<help>Parametrization to use</help>
</parameter>
<parameter key="%::ARG#::CLOUDINESS_TYPE" label="Cloudiness:" type="alternative" optional="true">
<option value="Crawford"/>
<option value="Kasten"/>
<option value="Lhomme"/>
<help>Cloudiness model to use (default: the model that belongs to the chosen ILWR parametrization). See the &lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/classmio_1_1TauCLDGenerator.html&quot;&gt;atmospheric transmissivity&lt;/a&gt; generator based on cloud cover fraction for more.</help>
</parameter>
<parameter key="%::ARG#::USE_RSWR" label="RSWR mode:" caption="Use RSWR" type="checkbox" default="FALSE">
<help>Should ISWR be computed from RSWR and an estimated albedo (not very precise)?</help>
......@@ -180,6 +188,12 @@ INIshell include file for MeteoIO generators
<parametergroup name="GENERATOR_TAU_CLD">
<option value="TAU_CLD">
<parameter key="%::ARG#::TYPE" label="Model:" type="alternative" optional="true">
<option value="Crawford"/>
<option value="Kasten"/>
<option value="Lhomme"/>
<help>Cloudiness model to use (default: Kasten)</help>
</parameter>
<parameter key="%::ARG#::USE_RSWR" label="RSWR mode:" caption="Use RSWR" type="checkbox" default="FALSE">
<help>Should ISWR be computed from RSWR and an estimated albedo (not very precise)?</help>
</parameter>
......
......@@ -263,10 +263,10 @@ Please include meteoio_parametergroups before use!
<parameter key="CSV_PURGE_CHARS" type="text" size="large" validate="^(?:\S|(\d{1,3})|(0[xX][0-9a-fA-F]{2}))(?:\s(\S|(\d{1,3})|(0[xX][0-9a-fA-F]{2})))*\s*$">
<help>Exclude a space delimited list of characters, either directly provided or as decimal representation or as hexadecimal representation prefixed by &lt;i&gt;0x&lt;/i&gt;. Example: &lt;i&gt;0x40 " 13&lt;/i&gt;</help>
</parameter>
<parameter key="CSV_EXCLUDE_LINES" type="text" size="large" validate="^(?:\d+(?:\s\-\s\d+)?(?:\s?,\s)?)+$">
<parameter key="CSV_EXCLUDE_LINES" type="text" size="large" validate="^(?:\d+(?:\s*\-\s*\d+)?(?:\s*,\s*)?)+$">
<help>Exclude a comma delimited list of line ranges (line numbers separated by ' - ') such as &lt;i&gt;456 - 468&lt;/i&gt; or individual lines. Please note that it is not possible to mix CSV_EXCLUDE_LINES and CSV_ONLY_LINES, only one type of specification may be provided.</help>
</parameter>
<parameter key="CSV_ONLY_LINES" type="text" size="large" validate="^(?:\d+(?:\s\-\s\d+)?(?:\s?,\s)?)+$">
<parameter key="CSV_ONLY_LINES" type="text" size="large" validate="^(?:\d+(?:\s*\-\s*\d+)?(?:\s*,\s*)?)+$">
<help>Restrict the parsing to a comma delimited list of line ranges (line numbers separated by ' - ') such as &lt;i&gt;456 - 468&lt;/i&gt; or individual lines. Please note that it is not possible to mix CSV_EXCLUDE_LINES and CSV_ONLY_LINES, only one type of specification may be provided.</help>
</parameter>
</frame>
......@@ -371,15 +371,15 @@ Please include meteoio_parametergroups before use!
<parametergroup name="CSV_NUMBERED_STATION">
<parameter type="alternative">
<option value="Show station specific settings">
<parameter key="CSV#_DELIMITER" type="text" default="," size="small">
<option value="Provide station specific settings">
<parameter key="CSV#_DELIMITER" type="text" size="small">
<help>Field delimiter character</help>
</parameter>
<parameter key="CSV#_NODATA" type="text">
<help>A space delimited list of strings that should be interpreted as &lt;code&gt;nodata&lt;/code&gt; (for example: NAN NULL -6999)</help>
</parameter>
<frame caption="Header handling" color="#c4c4c4">
<parameter key="CSV#_NR_HEADERS" type="number" format="integer+" min="0" default="1" notoggle="true">
<parameter key="CSV#_NR_HEADERS" type="number" format="integer+" min="0" notoggle="true">
<help>Number of header lines</help>
</parameter>
<parameter key="CSV#_HEADER_DELIMITER" type="text" default="" size="small">
......@@ -408,10 +408,10 @@ Please include meteoio_parametergroups before use!
<parameter key="CSV#_PURGE_CHARS" type="text" size="large" validate="^(?:\S|(\d{1,3})|(0[xX][0-9a-fA-F]{2}))(?:\s(\S|(\d{1,3})|(0[xX][0-9a-fA-F]{2})))*\s*$">
<help>Exclude a space delimited list of characters, either directly provided or as decimal representation or as hexadecimal representation prefixed by &lt;i&gt;0x&lt;/i&gt;. Example: &lt;i&gt;0x40 " 13&lt;/i&gt;</help>
</parameter>
<parameter key="CSV#_EXCLUDE_LINES" type="text" size="large" validate="^(?:\d+(?:\s\-\s\d+)?(?:\s?,\s)?)+$">
<parameter key="CSV#_EXCLUDE_LINES" type="text" size="large" validate="^(?:\d+(?:\s*\-\s*\d+)?(?:\s*,\s*)?)+$">
<help>Exclude a comma delimited list of line ranges (line numbers separated by ' - ') such as &lt;i&gt;456 - 468&lt;/i&gt; or individual lines. Please note that it is not possible to mix CSV_EXCLUDE_LINES and CSV_ONLY_LINES, only one type of specification may be provided.</help>
</parameter>
<parameter key="CSV#_ONLY_LINES" type="text" size="large" validate="^(?:\d+(?:\s\-\s\d+)?(?:\s?,\s)?)+$">
<parameter key="CSV#_ONLY_LINES" type="text" size="large" validate="^(?:\d+(?:\s*\-\s*\d+)?(?:\s*,\s*)?)+$">
<help>Restrict the parsing to a comma delimited list of line ranges (line numbers separated by ' - ') such as &lt;i&gt;456 - 468&lt;/i&gt; or individual lines. Please note that it is not possible to mix CSV_EXCLUDE_LINES and CSV_ONLY_LINES, only one type of specification may be provided.</help>
</parameter>
</frame>
......@@ -476,7 +476,7 @@ Please include meteoio_parametergroups before use!
</parameter>
</frame>
</option>
<option value="Hide station specific settings" default="true"/>
<option value="No station specific settings" default="true"/>
<help>If you have given station numbers you can set most of the keys from above individually for each station. If not set, the global value will be used.</help>
</parameter>
</parametergroup>
......
......@@ -367,6 +367,16 @@ https://models.slf.ch/p/snowpack
<option value="ASARC"/>
<help>Select the appropriate hand hardness parameterization</help>
</parameter>
<parameter key="MULTI_LAYER_SK38" type="alternative" default="FALSE" longlabel="true" optional="true">
<option value="TRUE"/>
<option value="FALSE"/>
<help>Use a multi layer SK38 index as in (Monti, Fabiano, et al., &lt;i&gt;"Snow instability evaluation: calculating the skier-induced stress in a multi-layered snowpack"&lt;/i&gt;, Natural Hazards and Earth System Sciences, 16.3, 2016). (default: false)</help>
</parameter>
<parameter key="SSI_IS_RTA" type="alternative" default="FALSE" longlabel="true" optional="true">
<option value="TRUE"/>
<option value="FALSE"/>
<help>Output the Relative Threshold Approach (Monti, Fabiano, and Jürg Schweizer, &lt;i&gt;"A relative difference approach to detect potential weak layers within a snow profile"&lt;/i&gt;, Proceedings ISSW, 2013) for stability evaluation instead of the SSI (default: false)</help>
</parameter>
</frame>
<frame caption="Extras" section="SnowpackAdvanced">
......
......@@ -132,10 +132,9 @@ void HelpWindow::createMenu()
menu_view->addAction(view_file_bugreport_);
connect(view_file_bugreport_, &QAction::triggered,
[]{ QDesktopServices::openUrl(QUrl("https://gitlabext.wsl.ch/snow-models/inishell/-/issues")); });
auto *show_paper = new QAction(tr("Show &paper..."), menu_view);
auto *show_paper = new QAction(tr("View Inishell &paper..."), menu_view);
menu_view->addAction(show_paper);
connect(show_paper, &QAction::triggered, this, [=]{ QDesktopServices::openUrl(QUrl(":doc/paper.pdf")); });
show_paper->setEnabled(false);
connect(show_paper, &QAction::triggered, this, [=]{ QDesktopServices::openUrl(QUrl("https://doi.org/10.5194/gmd-15-365-2022")); });
}
/**
......
......@@ -40,45 +40,6 @@
namespace os {
/**
* @brief Choose a number of locations to look for applications at.
* @param[out] locations List of locations which will have the system specific ones appended.
*/
void getSystemLocations(QStringList &locations)
{
#if defined Q_OS_WIN
locations << "../.."; //this is useful for some out of tree builds
locations << QCoreApplication::applicationDirPath(); //directory that contains the application executable
locations << QCoreApplication::applicationDirPath() + "/../share";
locations << QCoreApplication::applicationDirPath() + "/..";
locations << QStandardPaths::standardLocations(QStandardPaths::DesktopLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); //location where persistent application data can be stored
#endif
#if defined Q_OS_MAC
locations << "./../../../.."; //this is useful for some out of tree builds: we must get out of the bundle
locations << QCoreApplication::applicationDirPath();
locations << QCoreApplication::applicationDirPath() + "/../share";
locations << QCoreApplication::applicationDirPath() + "/..";
locations << QCoreApplication::applicationDirPath() + "/../../../.."; //we must get out of the bundle
locations << QStandardPaths::standardLocations(QStandardPaths::DesktopLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
locations << QDir::homePath() + "/usr/share";
#endif
#if !defined Q_OS_WIN && !defined Q_OS_MAC
locations << QCoreApplication::applicationDirPath(); //directory that contains the application executable
locations << QCoreApplication::applicationDirPath() + "/../share";
locations << QCoreApplication::applicationDirPath() + "/..";
locations << QStandardPaths::standardLocations(QStandardPaths::DesktopLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation); //$HOME/Documents
locations << QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::DataLocation);
locations << QDir::homePath() + "/usr/share";
#endif
}
/**
* @brief resolve and simplify a path. Unfortunatelly, there is no guarantee for a proper handling of UTF encodings,
* so only use this call to display nicer paths!
......@@ -156,6 +117,65 @@ bool isDarkTheme()
#endif
}
/**
* @brief Choose a number of locations to look for applications at.
* @param[out] locations List of locations which will have the system specific ones appended.
*/
void getSystemLocations(QStringList &locations)
{
const QString app_path( QCoreApplication::applicationDirPath() ); //directory that contains the application executable
//redundant locations are kept in each #ifdef in order to control the priority of each path, per plateform
#if defined Q_OS_WIN
locations << "../.."; //this is useful for some out of tree builds
locations << app_path;
locations << app_path + "/..";
locations << app_path + "/../share";
locations << QStandardPaths::standardLocations(QStandardPaths::DesktopLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); //location where persistent application data can be stored
#endif
#if defined Q_OS_MAC
locations << "./../../../.."; //this is useful for some out of tree builds: we must get out of the bundle
locations << app_path;
locations << app_path + "/..";
locations << app_path + "/../share";
locations << app_path + "/../../../.."; //we must get out of the bundle
const QString app_real_path( prettyPath(app_path) );
if (app_real_path!=app_path) {
locations << app_real_path;
locations << app_real_path + "/..";
locations << app_real_path + "/../share";
locations << app_real_path + "/../../../.."; //we must get out of the bundle
}
locations << QStandardPaths::standardLocations(QStandardPaths::DesktopLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
locations << QDir::homePath() + "/usr/share";
#endif
#if !defined Q_OS_WIN && !defined Q_OS_MAC
locations << app_path;
locations << app_path + "/..";
locations << app_path + "/../share";
const QString app_real_path( prettyPath(app_path) );
if (app_real_path!=app_path) {
locations << app_real_path;
locations << app_real_path + "/..";
locations << app_real_path + "/../share";
}
locations << QStandardPaths::standardLocations(QStandardPaths::DesktopLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation); //$HOME/Documents
locations << QStandardPaths::standardLocations(QStandardPaths::HomeLocation);
locations << QStandardPaths::standardLocations(QStandardPaths::DataLocation);
locations << QDir::homePath() + "/usr/share";
#endif
}
/**
* @brief Extended search paths for executables, to preprend or append to a PATH variable.
* @param[in] appname application's name.
......
......@@ -210,7 +210,11 @@ void FilePath::openFile()
}
if (!path.isNull()) {
setSetting("auto::history::last_panel_path", "path", QFileInfo( path ).absoluteDir().path());
const QFileInfo path_info( path+"/" );
if (path_info.isDir())
setSetting("auto::history::last_panel_path", "path", path_info.absolutePath());
else
setSetting("auto::history::last_panel_path", "path", path_info.absoluteDir().path());
//setProperty calls checkValue()
if (filename_only_)
this->setProperty("ini_value", QFileInfo( path ).fileName());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment