summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-22 12:52:14 (GMT)
committerAndreas Cord-Landwehr <cordlandwehr@kde.org>2016-10-22 12:52:14 (GMT)
commit1c09a84308bc808aff7baae95412e4e538b33685 (patch)
tree893d51f330d0cf2da7c586f57458f5c7c013bf70
parentab887aa80c84e597bd24163dd00a996024cc19dd (diff)
Fix port to QStandardPaths::locate(...)
-rw-r--r--plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp3
-rw-r--r--src/detailedQmlView.cpp3
-rw-r--r--src/detailedgraphicaloverview.cpp3
-rw-r--r--src/detailinfodlg.cpp6
-rw-r--r--src/kalzium.cpp4
-rw-r--r--src/kalziumschemetype.cpp12
-rw-r--r--src/tools/moleculeview.cpp3
7 files changed, 12 insertions, 22 deletions
diff --git a/plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp b/plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp
index 673dccb..f4c8cf6 100644
--- a/plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp
+++ b/plasmoid/applet/nuclearPlasmoid/kalziumdataobject.cpp
@@ -111,8 +111,7 @@ KalziumDataObject::KalziumDataObject()
//a settings-dialog where we can select the different iconsets...
QString setname = "school";
- QString pathname = QStandardPaths::locate(QStandardPaths::DataLocation, "data/iconsets/") + "data/iconsets/";
- pathname = QFileInfo(pathname).absolutePath();
+ QString pathname = QStandardPaths::locate(QStandardPaths::DataLocation, "data/iconsets/", QStandardPaths::LocateDirectory);
QString filename = pathname + setname + '/' + QString::number(i + 1) + ".svg";
diff --git a/src/detailedQmlView.cpp b/src/detailedQmlView.cpp
index 2ab5396..a746343 100644
--- a/src/detailedQmlView.cpp
+++ b/src/detailedQmlView.cpp
@@ -23,8 +23,7 @@ DetailedQmlView::DetailedQmlView(QWidget *parent) : QWidget(parent)
QDeclarativeView *view = new QDeclarativeView(this);
- QString qmlPath = QStandardPaths::locate(QStandardPaths::DataLocation, "qml/") + "qml/";
- qmlPath = QFileInfo(qmlPath).absolutePath();
+ QString qmlPath = QStandardPaths::locate(QStandardPaths::DataLocation, "qml/", QStandardPaths::LocateDirectory);
m_context = view->rootContext();
diff --git a/src/detailedgraphicaloverview.cpp b/src/detailedgraphicaloverview.cpp
index 1491690..606bb9c 100644
--- a/src/detailedgraphicaloverview.cpp
+++ b/src/detailedgraphicaloverview.cpp
@@ -84,8 +84,7 @@ void DetailedGraphicalOverview::paintEvent(QPaintEvent*)
} else if (Prefs::colorschemebox() == 2) { //The iconic view is the 3rd view (0,1,2,...)
pm.fill(palette().background().color());
- QString pathname = QStandardPaths::locate(QStandardPaths::DataLocation, "data/iconsets/") + "data/iconsets/";
- pathname = QFileInfo(pathname).absolutePath();
+ QString pathname = QStandardPaths::locate(QStandardPaths::DataLocation, "data/iconsets/", QStandardPaths::LocateDirectory);
int enumii = m_element->dataAsVariant(ChemicalDataObject::atomicNumber).toInt();
diff --git a/src/detailinfodlg.cpp b/src/detailinfodlg.cpp
index 05be17a..42265f8 100644
--- a/src/detailinfodlg.cpp
+++ b/src/detailinfodlg.cpp
@@ -59,10 +59,8 @@ DetailedInfoDlg::DetailedInfoDlg(int el, QWidget *parent) : KPageDialog(parent),
setButtonGuiItem(User2, KGuiItem(i18nc("Previous element", "Previous"),(layoutDirection() == Qt::LeftToRight) ? "arrow-left" : "arrow-right", i18n("Goes to the previous element")));
resize(820, 580);
*/
- m_baseHtml = QStandardPaths::locate(QStandardPaths::DataLocation, "data/") + "data/htmlview/";
- m_baseHtml = QFileInfo(m_baseHtml).absolutePath();
- m_baseHtml2 = QStandardPaths::locate(QStandardPaths::DataLocation, "data/") + "data/hazardsymbols/";
- m_baseHtml2 = QFileInfo(m_baseHtml2).absolutePath();
+ m_baseHtml = QStandardPaths::locate(QStandardPaths::DataLocation, "data/htmlview/", QStandardPaths::LocateDirectory);
+ m_baseHtml2 = QStandardPaths::locate(QStandardPaths::DataLocation, "data/hazardsymbols/", QStandardPaths::LocateDirectory);
//X m_picsdir = QStandardPaths::locate(QStandardPaths::DataLocation, "elempics/") + "elempics/";
//X m_picsdir = QFileInfo(m_picsdir).absolutePath();
diff --git a/src/kalzium.cpp b/src/kalzium.cpp
index b61720a..de99915 100644
--- a/src/kalzium.cpp
+++ b/src/kalzium.cpp
@@ -339,7 +339,7 @@ void Kalzium::slotGlossary()
// creating the glossary dialog and loading the glossaries we have
m_glossarydlg = new GlossaryDialog(this);
m_glossarydlg->setObjectName(QLatin1String("glossary"));
- QString dir = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kalzium/data/");
+ QString dir = QStandardPaths::locate(QStandardPaths::DataLocation, "data/", QStandardPaths::LocateDirectory);
dir = QFileInfo(dir).absolutePath();
QString picturepath = dir + "kalzium/data/bg.jpg";
QUrl u = QUrl::fromLocalFile(dir + "kalzium/data/knowledge.xml");
@@ -581,7 +581,7 @@ void Kalzium::elementHover(int num)
void Kalzium::extractIconicInformationAboutElement(int elementNumber)
{
QString setname = "school";
- QString pathname = QStandardPaths::locate(QStandardPaths::DataLocation, "data/iconsets/") + "data/iconsets/";
+ QString pathname = QStandardPaths::locate(QStandardPaths::DataLocation, "data/iconsets/", QStandardPaths::LocateDirectory);
pathname = QFileInfo(pathname).absolutePath();
QString filename = pathname + setname + '/' + "iconinformation.txt";
diff --git a/src/kalziumschemetype.cpp b/src/kalziumschemetype.cpp
index 79a9c18..4e67cfd 100644
--- a/src/kalziumschemetype.cpp
+++ b/src/kalziumschemetype.cpp
@@ -458,8 +458,7 @@ QList<legendPair> KalziumColorSchemeType::legendItems() const
//X
//X static QString resourcepath;
//X if (resourcepath.isEmpty()) {
-//X resourcepath = QStandardPaths::locate(QStandardPaths::DataLocation, "data/latticeicons/") + "data/latticeicons/";
-//X resourcepath = QFileInfo(resourcepath).absolutePath();
+//X resourcepath = QStandardPaths::locate(QStandardPaths::DataLocation, "data/latticeicons/");
//X }
//X
//X QString filename;
@@ -508,8 +507,7 @@ QList<legendPair> KalziumColorSchemeType::legendItems() const
//X static QString resourcepath;
//X if (resourcepath.isEmpty())
//X {
-//X resourcepath = QStandardPaths::locate(QStandardPaths::DataLocation, "data/latticeicons/") + "data/latticeicons/";
-//X resourcepath = QFileInfo(resourcepath).absolutePath();
+//X resourcepath = QStandardPaths::locate(QStandardPaths::DataLocation, "data/latticeicons/");
//X }
//X
//X QList<legendPair> ll;
@@ -554,8 +552,7 @@ QList<legendPair> KalziumColorSchemeType::legendItems() const
//X
//X static QString resourcepath;
//X if (resourcepath.isEmpty()) {
-//X resourcepath = QStandardPaths::locate(QStandardPaths::DataLocation, "data/maps/") + "data/maps/";
-//X resourcepath = QFileInfo(resourcepath).absolutePath();
+//X resourcepath = QStandardPaths::locate(QStandardPaths::DataLocation, "data/maps/");
//X }
//X
//X QString filename;
@@ -611,8 +608,7 @@ QList<legendPair> KalziumColorSchemeType::legendItems() const
//X {
//X static QString resourcepath;
//X if (resourcepath.isEmpty()) {
-//X resourcepath = QStandardPaths::locate(QStandardPaths::DataLocation, "data/maps/") + "data/maps/";
-//X resourcepath = QFileInfo(resourcepath).absolutePath();
+//X resourcepath = QStandardPaths::locate(QStandardPaths::DataLocation, "data/maps/");
//X }
//X
//X QList<legendPair> ll;
diff --git a/src/tools/moleculeview.cpp b/src/tools/moleculeview.cpp
index 3f19728..9d2753d 100644
--- a/src/tools/moleculeview.cpp
+++ b/src/tools/moleculeview.cpp
@@ -145,8 +145,7 @@ void MoleculeDialog::slotLoadMolecule()
KMessageBox::information(this, error);
}
- m_path = QStandardPaths::locate(QStandardPaths::DataLocation, "data/molecules/") + "data/molecules/";
- m_path = QFileInfo(m_path).absolutePath();
+ m_path = QStandardPaths::locate(QStandardPaths::DataLocation, "data/molecules/", QStandardPaths::LocateDirectory);
QString commonMoleculeFormats = i18n("Common molecule formats");
QString allFiles = i18n("All files");