Skip to content

Commit

Permalink
防止 .desktop 文件错乱
Browse files Browse the repository at this point in the history
  • Loading branch information
microcai committed Oct 7, 2024
1 parent 4c59542 commit ec24c98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Icon=edatool
Name=JLC EDA Tool
Type=Application
StartupWMClass=edatool
)ss";
Exec=)ss";

int main(int argc, char* argv[])
{
Expand All @@ -30,8 +30,10 @@ int main(int argc, char* argv[])
QFile desktopfile(QDir::homePath() + "/.local/share/applications/edatool.desktop");
if (desktopfile.open(QIODeviceBase::ReadWrite))
{
desktopfile.resize(sizeof (desktop_file_content));
desktopfile.write(desktop_file_content, sizeof (desktop_file_content) - 1);
desktopfile.write(QString("Exec=%1\n").arg(app.applicationFilePath()).toUtf8());
desktopfile.write(app.applicationFilePath().toUtf8());
desktopfile.write("\n", 1);
}
desktopfile.close();

Expand Down

0 comments on commit ec24c98

Please sign in to comment.