Switch to unified view

a/src/qtgui/rtitool.cpp b/src/qtgui/rtitool.cpp
...
...
102
        }
102
        }
103
    }
103
    }
104
    if (text.empty())
104
    if (text.empty())
105
        text = desktopfiletext;
105
        text = desktopfiletext;
106
106
107
  // Try to create .config and autostart anyway. If they exists this will 
108
  // do nothing. An error will be detected when we try to create the file
109
  string dir = path_cat(path_home(), ".config");
110
  mkdir(dir.c_str(), 0700);
111
  dir = path_cat(dir, "autostart");
112
  mkdir(dir.c_str(), 0700);
113
107
    int fd = ::open(autostartfile.c_str(), O_WRONLY|O_CREAT, 0644);
114
    int fd = ::open(autostartfile.c_str(), O_WRONLY|O_CREAT, 0644);
108
    if (fd < 0 || ::write(fd, text.c_str(), size_t(text.size())) 
115
    if (fd < 0 || ::write(fd, text.c_str(), size_t(text.size())) 
109
        != ssize_t(text.size()) || ::close(fd) != 0) {
116
        != ssize_t(text.size()) || ::close(fd) != 0) {
110
        if (fd >=0)
117
        if (fd >=0)
111
        ::close(fd);
118
        ::close(fd);