|
a/src/qtgui/rtitool.cpp |
|
b/src/qtgui/rtitool.cpp |
|
... |
|
... |
109 |
string dir = path_cat(path_home(), ".config");
|
109 |
string dir = path_cat(path_home(), ".config");
|
110 |
mkdir(dir.c_str(), 0700);
|
110 |
mkdir(dir.c_str(), 0700);
|
111 |
dir = path_cat(dir, "autostart");
|
111 |
dir = path_cat(dir, "autostart");
|
112 |
mkdir(dir.c_str(), 0700);
|
112 |
mkdir(dir.c_str(), 0700);
|
113 |
|
113 |
|
114 |
int fd = ::open(autostartfile.c_str(), O_WRONLY|O_CREAT, 0644);
|
114 |
string reason;
|
115 |
if (fd < 0 || ::write(fd, text.c_str(), size_t(text.size()))
|
115 |
if (!stringtofile(text, autostartfile.c_str(), reason)) {
|
116 |
!= ssize_t(text.size()) || ::close(fd) != 0) {
|
|
|
117 |
if (fd >=0)
|
|
|
118 |
::close(fd);
|
|
|
119 |
QString msg = tr("Can't create: ") +
|
116 |
QString msg = tr("Can't create: ") +
|
120 |
QString::fromLocal8Bit(autostartfile.c_str());
|
117 |
QString::fromLocal8Bit(autostartfile.c_str());
|
121 |
QMessageBox::warning(0, tr("Warning"), msg, QMessageBox::Ok);
|
118 |
QMessageBox::warning(0, tr("Warning"), msg, QMessageBox::Ok);
|
122 |
return;
|
119 |
return;
|
123 |
}
|
120 |
}
|
124 |
::close(fd);
|
|
|
125 |
|
121 |
|
126 |
if (nowCB->isChecked()) {
|
122 |
if (nowCB->isChecked()) {
|
127 |
ExecCmd cmd;
|
123 |
ExecCmd cmd;
|
128 |
vector<string> args;
|
124 |
vector<string> args;
|
129 |
int status;
|
125 |
int status;
|