author | erik <erik> | 2007-01-19 01:18:01 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-19 01:18:01 (UTC) |
commit | 32343107b30904806d02672955c57ed53d39fe79 (patch) (unidiff) | |
tree | 9114a0ea170e3adc807a2445b49360f1bfde9626 /noncore | |
parent | ac0ce844e90a64247c0adb210e0a23021b011d57 (diff) | |
download | opie-32343107b30904806d02672955c57ed53d39fe79.zip opie-32343107b30904806d02672955c57ed53d39fe79.tar.gz opie-32343107b30904806d02672955c57ed53d39fe79.tar.bz2 |
Every file in this commit has a change to check the return value of a call.
-rw-r--r-- | noncore/apps/advancedfm/output.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katebuffer.cpp | 5 | ||||
-rw-r--r-- | noncore/settings/usermanager/userdialog.cpp | 9 |
3 files changed, 13 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp index 8c585f4..8f654d5 100644 --- a/noncore/apps/advancedfm/output.cpp +++ b/noncore/apps/advancedfm/output.cpp | |||
@@ -147,98 +147,99 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
147 | proc = new OProcess(); | 147 | proc = new OProcess(); |
148 | 148 | ||
149 | connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), | 149 | connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), |
150 | this, SLOT( processFinished())); | 150 | this, SLOT( processFinished())); |
151 | 151 | ||
152 | connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), | 152 | connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), |
153 | this, SLOT(commandStdout(Opie::Core::OProcess*,char*,int))); | 153 | this, SLOT(commandStdout(Opie::Core::OProcess*,char*,int))); |
154 | 154 | ||
155 | connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), | 155 | connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), |
156 | this, SLOT(commandStderr(Opie::Core::OProcess*,char*,int))); | 156 | this, SLOT(commandStderr(Opie::Core::OProcess*,char*,int))); |
157 | 157 | ||
158 | // connect( , SIGNAL(received(const QByteArray&)), | 158 | // connect( , SIGNAL(received(const QByteArray&)), |
159 | // this, SLOT(commandStdin(const QByteArray&))); | 159 | // this, SLOT(commandStdin(const QByteArray&))); |
160 | 160 | ||
161 | // * proc << commands.latin1(); | 161 | // * proc << commands.latin1(); |
162 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { | 162 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { |
163 | odebug << "" << (*it).latin1() << "" << oendl; | 163 | odebug << "" << (*it).latin1() << "" << oendl; |
164 | * proc << (*it).latin1(); | 164 | * proc << (*it).latin1(); |
165 | } | 165 | } |
166 | 166 | ||
167 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { | 167 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { |
168 | 168 | ||
169 | OutputEdit->append(tr("Process could not start") ); | 169 | OutputEdit->append(tr("Process could not start") ); |
170 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 170 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
171 | perror("Error: "); | 171 | perror("Error: "); |
172 | QString errorMsg=tr("Error\n")+(QString)strerror(errno); | 172 | QString errorMsg=tr("Error\n")+(QString)strerror(errno); |
173 | OutputEdit->append( errorMsg); | 173 | OutputEdit->append( errorMsg); |
174 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 174 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | Output::~Output() { | 178 | Output::~Output() { |
179 | } | 179 | } |
180 | 180 | ||
181 | void Output::saveOutput() { | 181 | void Output::saveOutput() { |
182 | 182 | ||
183 | InputDialog *fileDlg; | 183 | InputDialog *fileDlg; |
184 | fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); | 184 | fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); |
185 | fileDlg->exec(); | 185 | fileDlg->exec(); |
186 | if( fileDlg->result() == 1 ) { | 186 | if( fileDlg->result() == 1 ) { |
187 | QString filename = QPEApplication::documentDir(); | 187 | QString filename = QPEApplication::documentDir(); |
188 | if(filename.right(1).find('/') == -1) | 188 | if(filename.right(1).find('/') == -1) |
189 | filename+="/"; | 189 | filename+="/"; |
190 | QString name = fileDlg->LineEdit1->text(); | 190 | QString name = fileDlg->LineEdit1->text(); |
191 | filename+="text/plain/"+name; | 191 | filename+="text/plain/"+name; |
192 | odebug << filename << oendl; | 192 | odebug << filename << oendl; |
193 | 193 | ||
194 | QFile f(filename); | 194 | QFile f(filename); |
195 | f.open( IO_WriteOnly); | 195 | if ( !f.open( IO_WriteOnly ) ) |
196 | if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { | 196 | owarn << "Could no open file" << oendl; |
197 | else if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { | ||
197 | DocLnk lnk; | 198 | DocLnk lnk; |
198 | lnk.setName(name); //sets file name | 199 | lnk.setName(name); //sets file name |
199 | lnk.setFile(filename); //sets File property | 200 | lnk.setFile(filename); //sets File property |
200 | lnk.setType("text/plain"); | 201 | lnk.setType("text/plain"); |
201 | if(!lnk.writeLink()) { | 202 | if(!lnk.writeLink()) { |
202 | odebug << "Writing doclink did not work" << oendl; | 203 | odebug << "Writing doclink did not work" << oendl; |
203 | } | 204 | } |
204 | } else | 205 | } else |
205 | owarn << "Could not write file" << oendl; | 206 | owarn << "Could not write file" << oendl; |
206 | f.close(); | 207 | f.close(); |
207 | } | 208 | } |
208 | } | 209 | } |
209 | 210 | ||
210 | void Output::commandStdout(OProcess*, char *buffer, int buflen) { | 211 | void Output::commandStdout(OProcess*, char *buffer, int buflen) { |
211 | owarn << "received stdout " << buflen << " bytes" << oendl; | 212 | owarn << "received stdout " << buflen << " bytes" << oendl; |
212 | 213 | ||
213 | // QByteArray data(buflen); | 214 | // QByteArray data(buflen); |
214 | // data.fill(*buffer, buflen); | 215 | // data.fill(*buffer, buflen); |
215 | // for (uint i = 0; i < data.count(); i++ ) { | 216 | // for (uint i = 0; i < data.count(); i++ ) { |
216 | // printf("%c", buffer[i] ); | 217 | // printf("%c", buffer[i] ); |
217 | // } | 218 | // } |
218 | // printf("\n"); | 219 | // printf("\n"); |
219 | 220 | ||
220 | QString lineStr = buffer; | 221 | QString lineStr = buffer; |
221 | lineStr=lineStr.left(lineStr.length()-1); | 222 | lineStr=lineStr.left(lineStr.length()-1); |
222 | OutputEdit->append(lineStr); | 223 | OutputEdit->append(lineStr); |
223 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 224 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
224 | } | 225 | } |
225 | 226 | ||
226 | 227 | ||
227 | void Output::commandStdin( const QByteArray &data) { | 228 | void Output::commandStdin( const QByteArray &data) { |
228 | owarn << "received stdin " << data.size() << " bytes" << oendl; | 229 | owarn << "received stdin " << data.size() << " bytes" << oendl; |
229 | // recieved data from the io layer goes to sz | 230 | // recieved data from the io layer goes to sz |
230 | proc->writeStdin(data.data(), data.size()); | 231 | proc->writeStdin(data.data(), data.size()); |
231 | } | 232 | } |
232 | 233 | ||
233 | void Output::commandStderr(OProcess*, char *buffer, int buflen) { | 234 | void Output::commandStderr(OProcess*, char *buffer, int buflen) { |
234 | owarn << "received stderrt " << buflen << " bytes" << oendl; | 235 | owarn << "received stderrt " << buflen << " bytes" << oendl; |
235 | 236 | ||
236 | QString lineStr = buffer; | 237 | QString lineStr = buffer; |
237 | // lineStr=lineStr.left(lineStr.length()-1); | 238 | // lineStr=lineStr.left(lineStr.length()-1); |
238 | OutputEdit->append(lineStr); | 239 | OutputEdit->append(lineStr); |
239 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 240 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
240 | } | 241 | } |
241 | 242 | ||
242 | void Output::processFinished() { | 243 | void Output::processFinished() { |
243 | 244 | ||
244 | delete proc; | 245 | delete proc; |
diff --git a/noncore/apps/tinykate/libkate/document/katebuffer.cpp b/noncore/apps/tinykate/libkate/document/katebuffer.cpp index 4c15fd0..d89edbd 100644 --- a/noncore/apps/tinykate/libkate/document/katebuffer.cpp +++ b/noncore/apps/tinykate/libkate/document/katebuffer.cpp | |||
@@ -27,97 +27,100 @@ | |||
27 | /* OPIE */ | 27 | /* OPIE */ |
28 | #include <opie2/odebug.h> | 28 | #include <opie2/odebug.h> |
29 | 29 | ||
30 | /* QT */ | 30 | /* QT */ |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qtimer.h> | 33 | #include <qtimer.h> |
34 | #include <qtextcodec.h> | 34 | #include <qtextcodec.h> |
35 | 35 | ||
36 | /* STD */ | 36 | /* STD */ |
37 | // Includes for reading file | 37 | // Includes for reading file |
38 | #include <sys/types.h> | 38 | #include <sys/types.h> |
39 | #include <sys/stat.h> | 39 | #include <sys/stat.h> |
40 | #include <fcntl.h> | 40 | #include <fcntl.h> |
41 | #include <errno.h> | 41 | #include <errno.h> |
42 | #include <unistd.h> | 42 | #include <unistd.h> |
43 | #include <assert.h> | 43 | #include <assert.h> |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * Create an empty buffer. | 46 | * Create an empty buffer. |
47 | */ | 47 | */ |
48 | KWBuffer::KWBuffer() | 48 | KWBuffer::KWBuffer() |
49 | { | 49 | { |
50 | clear(); | 50 | clear(); |
51 | } | 51 | } |
52 | 52 | ||
53 | void | 53 | void |
54 | KWBuffer::clear() | 54 | KWBuffer::clear() |
55 | { | 55 | { |
56 | m_stringListIt=0; | 56 | m_stringListIt=0; |
57 | m_stringListCurrent=0; | 57 | m_stringListCurrent=0; |
58 | m_stringList.clear(); | 58 | m_stringList.clear(); |
59 | m_lineCount=1; | 59 | m_lineCount=1; |
60 | m_stringListIt = m_stringList.append(new TextLine()); | 60 | m_stringListIt = m_stringList.append(new TextLine()); |
61 | } | 61 | } |
62 | 62 | ||
63 | /** | 63 | /** |
64 | * Insert a file at line @p line in the buffer. | 64 | * Insert a file at line @p line in the buffer. |
65 | */ | 65 | */ |
66 | void | 66 | void |
67 | KWBuffer::insertFile(int line, const QString &file, QTextCodec *codec) | 67 | KWBuffer::insertFile(int line, const QString &file, QTextCodec *codec) |
68 | { | 68 | { |
69 | if (line) { | 69 | if (line) { |
70 | odebug << "insert File only supports insertion at line 0 == file opening" << oendl; | 70 | odebug << "insert File only supports insertion at line 0 == file opening" << oendl; |
71 | return; | 71 | return; |
72 | } | 72 | } |
73 | clear(); | 73 | clear(); |
74 | QFile iofile(file); | 74 | QFile iofile(file); |
75 | iofile.open(IO_ReadOnly); | 75 | if (!iofile.open(IO_ReadOnly)) { |
76 | owarn << "failed to open file " << iofile.name() << oendl; | ||
77 | return; | ||
78 | } | ||
76 | QTextStream stream(&iofile); | 79 | QTextStream stream(&iofile); |
77 | stream.setCodec(codec); | 80 | stream.setCodec(codec); |
78 | QString qsl; | 81 | QString qsl; |
79 | int count=0; | 82 | int count=0; |
80 | for (count=0;((qsl=stream.readLine())!=QString::null); count++) | 83 | for (count=0;((qsl=stream.readLine())!=QString::null); count++) |
81 | { | 84 | { |
82 | if (count==0) | 85 | if (count==0) |
83 | { | 86 | { |
84 | (*m_stringListIt)->append(qsl.unicode(),qsl.length()); | 87 | (*m_stringListIt)->append(qsl.unicode(),qsl.length()); |
85 | } | 88 | } |
86 | else | 89 | else |
87 | { | 90 | { |
88 | TextLine::Ptr tl=new TextLine(); | 91 | TextLine::Ptr tl=new TextLine(); |
89 | tl ->append(qsl.unicode(),qsl.length()); | 92 | tl ->append(qsl.unicode(),qsl.length()); |
90 | m_stringListIt=m_stringList.append(tl); | 93 | m_stringListIt=m_stringList.append(tl); |
91 | } | 94 | } |
92 | } | 95 | } |
93 | if (count!=0) | 96 | if (count!=0) |
94 | { | 97 | { |
95 | m_stringListCurrent=count-1; | 98 | m_stringListCurrent=count-1; |
96 | m_lineCount=count; | 99 | m_lineCount=count; |
97 | } | 100 | } |
98 | } | 101 | } |
99 | 102 | ||
100 | void | 103 | void |
101 | KWBuffer::loadFilePart() | 104 | KWBuffer::loadFilePart() |
102 | { | 105 | { |
103 | } | 106 | } |
104 | 107 | ||
105 | 108 | ||
106 | void | 109 | void |
107 | KWBuffer::insertData(int line, const QByteArray &data, QTextCodec *codec) | 110 | KWBuffer::insertData(int line, const QByteArray &data, QTextCodec *codec) |
108 | { | 111 | { |
109 | } | 112 | } |
110 | 113 | ||
111 | void | 114 | void |
112 | KWBuffer::slotLoadFile() | 115 | KWBuffer::slotLoadFile() |
113 | { | 116 | { |
114 | loadFilePart(); | 117 | loadFilePart(); |
115 | // emit linesChanged(m_totalLines); | 118 | // emit linesChanged(m_totalLines); |
116 | emit linesChanged(20); | 119 | emit linesChanged(20); |
117 | } | 120 | } |
118 | 121 | ||
119 | /** | 122 | /** |
120 | * Return the total number of lines in the buffer. | 123 | * Return the total number of lines in the buffer. |
121 | */ | 124 | */ |
122 | int | 125 | int |
123 | KWBuffer::count() | 126 | KWBuffer::count() |
diff --git a/noncore/settings/usermanager/userdialog.cpp b/noncore/settings/usermanager/userdialog.cpp index 3654639..75a96a6 100644 --- a/noncore/settings/usermanager/userdialog.cpp +++ b/noncore/settings/usermanager/userdialog.cpp | |||
@@ -197,99 +197,102 @@ void UserDialog::setupTab2() | |||
197 | 197 | ||
198 | myTabWidget->addTab(tabpage,"User Groups"); | 198 | myTabWidget->addTab(tabpage,"User Groups"); |
199 | } | 199 | } |
200 | 200 | ||
201 | /** | 201 | /** |
202 | * Static function that creates the userinfo dialog. | 202 | * Static function that creates the userinfo dialog. |
203 | * The user will be prompted to add a user. | 203 | * The user will be prompted to add a user. |
204 | * | 204 | * |
205 | * @param uid This is a suggested available UID. | 205 | * @param uid This is a suggested available UID. |
206 | * @param gid This is a suggested available GID. | 206 | * @param gid This is a suggested available GID. |
207 | * | 207 | * |
208 | * @return <code>true</code> if the user was successfully added, otherwise <code>false</code>. | 208 | * @return <code>true</code> if the user was successfully added, otherwise <code>false</code>. |
209 | * | 209 | * |
210 | */ | 210 | */ |
211 | bool UserDialog::addUser(int uid, int gid) | 211 | bool UserDialog::addUser(int uid, int gid) |
212 | { | 212 | { |
213 | QCheckListItem *temp; | 213 | QCheckListItem *temp; |
214 | QFile ozTest; | 214 | QFile ozTest; |
215 | int oz=false; | 215 | int oz=false; |
216 | if(ODevice::inst()->system()==System_OpenZaurus) oz=true; | 216 | if(ODevice::inst()->system()==System_OpenZaurus) oz=true; |
217 | // viewmode is a workaround for a bug in qte-2.3.4 that gives bus error on manipulating adduserDialog's widgets here. | 217 | // viewmode is a workaround for a bug in qte-2.3.4 that gives bus error on manipulating adduserDialog's widgets here. |
218 | UserDialog *adduserDialog=new UserDialog(VIEWMODE_NEW); | 218 | UserDialog *adduserDialog=new UserDialog(VIEWMODE_NEW); |
219 | adduserDialog->setCaption(tr("Add User")); | 219 | adduserDialog->setCaption(tr("Add User")); |
220 | adduserDialog->userID=uid; // Set next available UID as default uid. | 220 | adduserDialog->userID=uid; // Set next available UID as default uid. |
221 | adduserDialog->groupID=gid; // Set next available GID as default gid. | 221 | adduserDialog->groupID=gid; // Set next available GID as default gid. |
222 | // Insert default group into groupComboBox | 222 | // Insert default group into groupComboBox |
223 | adduserDialog->groupComboBox->insertItem("<create new group>",0); | 223 | adduserDialog->groupComboBox->insertItem("<create new group>",0); |
224 | adduserDialog->uidLineEdit->setText(QString::number(uid)); | 224 | adduserDialog->uidLineEdit->setText(QString::number(uid)); |
225 | // If we're running on OZ, add new users to some default groups. | 225 | // If we're running on OZ, add new users to some default groups. |
226 | if(oz) | 226 | if(oz) |
227 | { | 227 | { |
228 | QListViewItemIterator iter( adduserDialog->groupsListView ); | 228 | QListViewItemIterator iter( adduserDialog->groupsListView ); |
229 | for ( ; iter.current(); ++iter ) | 229 | for ( ; iter.current(); ++iter ) |
230 | { | 230 | { |
231 | temp=(QCheckListItem*)iter.current(); | 231 | temp=(QCheckListItem*)iter.current(); |
232 | if (temp->text()=="video") temp->setOn(true); | 232 | if (temp->text()=="video") temp->setOn(true); |
233 | if (temp->text()=="audio") temp->setOn(true); | 233 | if (temp->text()=="audio") temp->setOn(true); |
234 | if (temp->text()=="time") temp->setOn(true); | 234 | if (temp->text()=="time") temp->setOn(true); |
235 | if (temp->text()=="power") temp->setOn(true); | 235 | if (temp->text()=="power") temp->setOn(true); |
236 | if (temp->text()=="input") temp->setOn(true); | 236 | if (temp->text()=="input") temp->setOn(true); |
237 | if (temp->text()=="sharp") temp->setOn(true); | 237 | if (temp->text()=="sharp") temp->setOn(true); |
238 | if (temp->text()=="tty") temp->setOn(true); | 238 | if (temp->text()=="tty") temp->setOn(true); |
239 | } | 239 | } |
240 | } | 240 | } |
241 | // Show the dialog! | 241 | // Show the dialog! |
242 | if(!(adduserDialog->exec())) return false; | 242 | if(!(adduserDialog->exec())) return false; |
243 | if((adduserDialog->groupComboBox->currentItem()!=0)) | 243 | if((adduserDialog->groupComboBox->currentItem()!=0)) |
244 | { | 244 | { |
245 | accounts->findGroup(adduserDialog->groupComboBox->currentText()); | 245 | // making the call findGroup() puts the group info in the accounts gr_gid |
246 | adduserDialog->groupID=accounts->gr_gid; | 246 | if (accounts->findGroup(adduserDialog->groupComboBox->currentText())) |
247 | owarn << QString::number(accounts->gr_gid) << oendl; | 247 | { |
248 | adduserDialog->groupID=accounts->gr_gid; | ||
249 | owarn << QString::number(accounts->gr_gid) << oendl; | ||
250 | } | ||
248 | } | 251 | } |
249 | if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), | 252 | if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(), |
250 | adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), | 253 | adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(), |
251 | QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) | 254 | QString("/home/")+adduserDialog->loginLineEdit->text() , adduserDialog->shellComboBox->currentText()))) |
252 | { | 255 | { |
253 | QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); | 256 | QMessageBox::information(0,"Ooops!","Something went wrong!\nUnable to add user."); |
254 | return false; | 257 | return false; |
255 | } | 258 | } |
256 | 259 | ||
257 | // Add User to additional groups. | 260 | // Add User to additional groups. |
258 | QListViewItemIterator it( adduserDialog->groupsListView ); | 261 | QListViewItemIterator it( adduserDialog->groupsListView ); |
259 | for ( ; it.current(); ++it ) | 262 | for ( ; it.current(); ++it ) |
260 | { | 263 | { |
261 | temp=(QCheckListItem*)it.current(); | 264 | temp=(QCheckListItem*)it.current(); |
262 | if (temp->isOn() ) | 265 | if (temp->isOn() ) |
263 | accounts->addGroupMember(it.current()->text(0),adduserDialog->loginLineEdit->text()); | 266 | accounts->addGroupMember(it.current()->text(0),adduserDialog->loginLineEdit->text()); |
264 | } | 267 | } |
265 | // Copy image to pics/users/ | 268 | // Copy image to pics/users/ |
266 | if(!(adduserDialog->userImage.isNull())) | 269 | if(!(adduserDialog->userImage.isNull())) |
267 | { | 270 | { |
268 | QDir d; | 271 | QDir d; |
269 | if(!(d.exists(QPEApplication::qpeDir() + "pics/users"))) | 272 | if(!(d.exists(QPEApplication::qpeDir() + "pics/users"))) |
270 | { | 273 | { |
271 | d.mkdir(QPEApplication::qpeDir() + "pics/users"); | 274 | d.mkdir(QPEApplication::qpeDir() + "pics/users"); |
272 | } | 275 | } |
273 | QString filename= QPEApplication::qpeDir()+"pics/users/"+accounts->pw_name+".png"; | 276 | QString filename= QPEApplication::qpeDir()+"pics/users/"+accounts->pw_name+".png"; |
274 | // adduserDialog->userImage=adduserDialog->userImage.smoothScale(48,48); | 277 | // adduserDialog->userImage=adduserDialog->userImage.smoothScale(48,48); |
275 | adduserDialog->userImage.save(filename,"PNG"); | 278 | adduserDialog->userImage.save(filename,"PNG"); |
276 | } | 279 | } |
277 | 280 | ||
278 | // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory? | 281 | // Should we copy the skeleton homedirectory /etc/skel to the user's homedirectory? |
279 | accounts->findUser(adduserDialog->loginLineEdit->text()); | 282 | accounts->findUser(adduserDialog->loginLineEdit->text()); |
280 | if(adduserDialog->skelCheckBox->isChecked()) | 283 | if(adduserDialog->skelCheckBox->isChecked()) |
281 | { | 284 | { |
282 | QString command_cp; | 285 | QString command_cp; |
283 | QString command_chown; | 286 | QString command_chown; |
284 | command_cp.sprintf("cp -a /etc/skel/* %s/",accounts->pw_dir.latin1()); | 287 | command_cp.sprintf("cp -a /etc/skel/* %s/",accounts->pw_dir.latin1()); |
285 | system(command_cp); | 288 | system(command_cp); |
286 | 289 | ||
287 | command_cp.sprintf("cp -a /etc/skel/.[!.]* %s/",accounts->pw_dir.latin1()); // Bug in busybox, ".*" includes parent directory, does this work as a workaround? | 290 | command_cp.sprintf("cp -a /etc/skel/.[!.]* %s/",accounts->pw_dir.latin1()); // Bug in busybox, ".*" includes parent directory, does this work as a workaround? |
288 | system(command_cp); | 291 | system(command_cp); |
289 | 292 | ||
290 | command_chown.sprintf("chown -R %d:%d %s",accounts->pw_uid,accounts->pw_gid,accounts->pw_dir.latin1()); | 293 | command_chown.sprintf("chown -R %d:%d %s",accounts->pw_uid,accounts->pw_gid,accounts->pw_dir.latin1()); |
291 | system(command_chown); | 294 | system(command_chown); |
292 | } | 295 | } |
293 | 296 | ||
294 | return true; | 297 | return true; |
295 | } | 298 | } |