summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/output.cpp5
-rw-r--r--noncore/apps/tinykate/libkate/document/katebuffer.cpp5
-rw-r--r--noncore/settings/usermanager/userdialog.cpp9
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
@@ -192,8 +192,9 @@ void Output::saveOutput() {
odebug << filename << oendl;
QFile f(filename);
- f.open( IO_WriteOnly);
- if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) {
+ if ( !f.open( IO_WriteOnly ) )
+ owarn << "Could no open file" << oendl;
+ else if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) {
DocLnk lnk;
lnk.setName(name); //sets file name
lnk.setFile(filename); //sets File property
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
@@ -72,7 +72,10 @@ KWBuffer::insertFile(int line, const QString &file, QTextCodec *codec)
}
clear();
QFile iofile(file);
- iofile.open(IO_ReadOnly);
+ if (!iofile.open(IO_ReadOnly)) {
+ owarn << "failed to open file " << iofile.name() << oendl;
+ return;
+ }
QTextStream stream(&iofile);
stream.setCodec(codec);
QString qsl;
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
@@ -242,9 +242,12 @@ bool UserDialog::addUser(int uid, int gid)
if(!(adduserDialog->exec())) return false;
if((adduserDialog->groupComboBox->currentItem()!=0))
{
- accounts->findGroup(adduserDialog->groupComboBox->currentText());
- adduserDialog->groupID=accounts->gr_gid;
- owarn << QString::number(accounts->gr_gid) << oendl;
+ // making the call findGroup() puts the group info in the accounts gr_gid
+ if (accounts->findGroup(adduserDialog->groupComboBox->currentText()))
+ {
+ adduserDialog->groupID=accounts->gr_gid;
+ owarn << QString::number(accounts->gr_gid) << oendl;
+ }
}
if(!(accounts->addUser(adduserDialog->loginLineEdit->text(), adduserDialog->passwordLineEdit->text(),
adduserDialog->uidLineEdit->text().toInt(), adduserDialog->groupID, adduserDialog->gecosLineEdit->text(),