Commit 5e5731fe authored by JanKusanagi's avatar JanKusanagi

Fix bug when changing custom tray icon but cancelling

parent 7180259a
......@@ -1023,7 +1023,7 @@ void ConfigDialog::saveConfiguration()
void ConfigDialog::pickCustomIconFile()
{
m_systrayCustomIconFN = QFileDialog::getOpenFileName(this,
QString newTrayIconFN = QFileDialog::getOpenFileName(this,
tr("Select custom icon"),
m_systrayIconLastDir,
tr("Image files")
......@@ -1032,15 +1032,16 @@ void ConfigDialog::pickCustomIconFile()
+ tr("All files")
+ " (*)");
if (!m_systrayCustomIconFN.isEmpty())
if (!newTrayIconFN.isEmpty())
{
qDebug() << "Selected" << m_systrayCustomIconFN << "as new custom tray icon";
QFileInfo fileInfo(m_systrayCustomIconFN);
qDebug() << "Selected" << newTrayIconFN << "as new custom tray icon";
QFileInfo fileInfo(newTrayIconFN);
m_systrayIconLastDir = fileInfo.path();
QPixmap iconPixmap = QPixmap(m_systrayCustomIconFN);
QPixmap iconPixmap = QPixmap(newTrayIconFN);
if (!iconPixmap.isNull())
{
m_systrayCustomIconFN = newTrayIconFN;
m_systrayCustomIconButton->setIcon(QIcon(m_systrayCustomIconFN));
m_systrayCustomIconButton->setToolTip("<b></b>"
+ m_systrayCustomIconFN);
......
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