mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Correction to configuration path override in AbstractView pt2 (#4681)
Continuation of #4661
This commit is contained in:
@@ -41,7 +41,7 @@ AbstractView::AbstractView(Context *context, int type, const QString& view, cons
|
||||
sidebar_(NULL), bottom_(NULL), perspective_(NULL), blank_(NULL),
|
||||
loaded(false)
|
||||
{
|
||||
|
||||
viewCfgPath = context->athlete->home->config().canonicalPath();
|
||||
defaultAppearance= GSettings::defaultAppearanceSettings();
|
||||
|
||||
// setup the basic widget
|
||||
@@ -253,12 +253,6 @@ AbstractView::configChanged(qint32)
|
||||
if (sidebar_) sidebar_->setStyleSheet(ourStyleSheet());
|
||||
}
|
||||
|
||||
QString
|
||||
AbstractView::getPathToPerspectiveFile()
|
||||
{
|
||||
return context->athlete->home->config().canonicalPath();
|
||||
}
|
||||
|
||||
void
|
||||
AbstractView::saveState()
|
||||
{
|
||||
@@ -270,7 +264,7 @@ AbstractView::saveState()
|
||||
// we do not save all the other Qt properties since
|
||||
// we're not interested in them
|
||||
// NOTE: currently we support QString, int, double and bool types - beware custom types!!
|
||||
QString filename = getPathToPerspectiveFile() + "/" + view + "-perspectives.xml";
|
||||
QString filename = viewCfgPath + "/" + view + "-perspectives.xml";
|
||||
|
||||
QFile file(filename);
|
||||
if (!file.open(QFile::WriteOnly)) {
|
||||
@@ -304,7 +298,7 @@ void
|
||||
AbstractView::restoreState(bool useDefault)
|
||||
{
|
||||
// restore window state
|
||||
QString filename = getPathToPerspectiveFile() + "/" + view + "-perspectives.xml";
|
||||
QString filename = viewCfgPath + "/" + view + "-perspectives.xml";
|
||||
|
||||
QFileInfo finfo(filename);
|
||||
|
||||
|
||||
@@ -153,6 +153,7 @@ class AbstractView : public QWidget
|
||||
// we don't care what values are pass through to the GcWindowRegistry to decide
|
||||
// what charts are relevant for this view.
|
||||
const QString view; // type of view: "train", "analysis", "diary", "home"
|
||||
QString viewCfgPath; // directory path to the view's configuration
|
||||
|
||||
// properties
|
||||
bool _filtered;
|
||||
@@ -189,7 +190,6 @@ class AbstractView : public QWidget
|
||||
virtual void notifyViewSidebarChanged() {}
|
||||
virtual void setViewSpecificPerspective() {};
|
||||
virtual void notifyViewSplitterMoved() {};
|
||||
virtual QString getPathToPerspectiveFile();
|
||||
|
||||
private slots:
|
||||
void onIdle();
|
||||
|
||||
Reference in New Issue
Block a user