Commit b98a30ea authored by Martin Koller's avatar Martin Koller

open home dir after settings are restored, else wrong position visible

parent 9265eead
......@@ -122,6 +122,9 @@ MainWindow::MainWindow()
docked->setChecked(KSharedConfig::openConfig()->group("settings").readEntry<bool>("dockInSysTray", false));
dockInSysTray(docked->isChecked());
// for convenience, open the tree at the HOME directory
selector->openHomeDir();
changeSystrayTip();
}
......
......@@ -262,18 +262,6 @@ Selector::Selector(QWidget *parent, KActionCollection *actionCollection)
connect(this, &Selector::expanded, this, &Selector::expandedSlot);
// for convenience, open the tree at the HOME directory
const char *home = ::getenv("HOME");
if ( home )
{
QStandardItem *homeItem = findItemByPath(QFile::decodeName(home));
if ( homeItem )
{
setExpanded(homeItem->index(), true);
scrollTo(homeItem->index());
}
}
minSize = QSize(columnWidth(0) + columnWidth(1), -1);
resizeColumnToContents(0);
resizeColumnToContents(1);
......@@ -310,6 +298,22 @@ Selector::Selector(QWidget *parent, KActionCollection *actionCollection)
//--------------------------------------------------------------------------------
void Selector::openHomeDir()
{
const char *home = ::getenv("HOME");
if ( home )
{
QStandardItem *homeItem = findItemByPath(QFile::decodeName(home));
if ( homeItem )
{
setExpanded(homeItem->index(), true);
scrollTo(homeItem->index());
}
}
}
//--------------------------------------------------------------------------------
QSize Selector::minimumSizeHint() const
{
return minSize;
......
......@@ -31,6 +31,7 @@ class Selector : public QTreeView
void getBackupList(QStringList &includes, QStringList &excludes) const;
void setBackupList(const QStringList &includes, const QStringList &excludes);
void setShowHiddenFiles(bool show);
void openHomeDir();
QSize minimumSizeHint() const override;
......
Markdown is supported
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