We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9188d0 commit e70534bCopy full SHA for e70534b
1 file changed
AppAdder/mainwindow.cpp
@@ -37,6 +37,17 @@ std::string getFilePath(std::string path) {
37
return path;
38
}
39
40
+// Writes data to the .desktop file
41
+void writeData(std::string data, std::string name) {
42
+ std::string path = homedir;
43
+ path += "/.local/share/applications/" + name + ".desktop";
44
+
45
+ std::ofstream file(path);
46
+ file << data;
47
48
+ file.close();
49
+}
50
51
52
MainWindow::~MainWindow() {
53
delete ui;
@@ -130,5 +141,7 @@ void MainWindow::on_createButton_clicked() {
130
141
fileContents += "\n[Desktop Action Remove]\n";
131
142
fileContents += "Name=Uninstall app from system\n";
132
143
fileContents += "Exec=rm " + copyToLocation + " " + imageCopyLocation + "\n";
144
145
+ writeData(fileContents, name.toUtf8().constData());
133
146
134
147
0 commit comments