[UNTESTED] Linux: add icons to shortcuts

Signed-off-by: ADudeCalledLeo <7997354+Leo40Git@users.noreply.github.com>
This commit is contained in:
ADudeCalledLeo 2022-10-25 17:37:30 +03:00
parent 70768189ba
commit f12117c532
No known key found for this signature in database
GPG Key ID: 2E08DA5D6AF36F3B

View File

@ -2104,6 +2104,8 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
// TODO actually write this path // TODO actually write this path
QMessageBox::critical(this, tr("Create instance shortcut"), tr("Not supported on macOSX yet!")); QMessageBox::critical(this, tr("Create instance shortcut"), tr("Not supported on macOSX yet!"));
#else #else
auto icon = APPLICATION->icons()->icon(m_selectedInstance->iconKey());
QString iconPath; QString iconPath;
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
@ -2111,7 +2113,7 @@ void MainWindow::on_actionCreateInstanceShortcut_triggered()
// need to convert icon to ICO format and save it somewhere... // need to convert icon to ICO format and save it somewhere...
iconPath = ""; iconPath = "";
#elif defined(Q_OS_UNIX) #elif defined(Q_OS_UNIX)
iconPath = ""; // TODO get instance icon path iconPath = icon->getFilePath();
#endif #endif
if (FS::createShortcut(FS::PathCombine(desktopPath, m_selectedInstance->name()), if (FS::createShortcut(FS::PathCombine(desktopPath, m_selectedInstance->name()),
QApplication::applicationFilePath(), { "--launch", m_selectedInstance->id() }, m_selectedInstance->name(), iconPath)) { QApplication::applicationFilePath(), { "--launch", m_selectedInstance->id() }, m_selectedInstance->name(), iconPath)) {