[Tux4kids-commits] r1436 - tux4kids-admin/trunk/libtux4kidsadmin
Michał Świtakowski
swistakers-guest at alioth.debian.org
Fri Aug 14 22:58:00 UTC 2009
Author: swistakers-guest
Date: 2009-08-14 22:58:00 +0000 (Fri, 14 Aug 2009)
New Revision: 1436
Modified:
tux4kids-admin/trunk/libtux4kidsadmin/computerDir.cpp
tux4kids-admin/trunk/libtux4kidsadmin/schoolData.cpp
tux4kids-admin/trunk/libtux4kidsadmin/studentDir.cpp
Log:
some fixes
Modified: tux4kids-admin/trunk/libtux4kidsadmin/computerDir.cpp
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin/computerDir.cpp 2009-08-14 22:47:29 UTC (rev 1435)
+++ tux4kids-admin/trunk/libtux4kidsadmin/computerDir.cpp 2009-08-14 22:58:00 UTC (rev 1436)
@@ -6,14 +6,14 @@
ComputerDirPrivate::ComputerDirPrivate(QString path, int num)
{
QDir parentDir(path);
- QString dirName = QString("computer%1").arg(number);
+ number = num;
+ QString dirName = QString("computer_%1").arg(number);
if (!parentDir.exists(dirName)) {
if (!parentDir.mkdir(dirName)) {
//report error
}
}
mainDir.setPath(parentDir.absoluteFilePath(dirName));
- number = num;
}
ComputerDirPrivate::~ComputerDirPrivate()
Modified: tux4kids-admin/trunk/libtux4kidsadmin/schoolData.cpp
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin/schoolData.cpp 2009-08-14 22:47:29 UTC (rev 1435)
+++ tux4kids-admin/trunk/libtux4kidsadmin/schoolData.cpp 2009-08-14 22:58:00 UTC (rev 1436)
@@ -73,7 +73,7 @@
void SchoolDataPrivate::createComputerDirs()
{
int computerCount = attributes->value("computer_count", 0).toInt();
- for (int i = 0; i <= computerCount; ++i) {
+ for (int i = 1; i <= computerCount; ++i) {
ComputerDir *computerDir = new ComputerDir(mainDir.absolutePath(), i);
computers.append(computerDir);
studentComputers[computerDir] = 0;
Modified: tux4kids-admin/trunk/libtux4kidsadmin/studentDir.cpp
===================================================================
--- tux4kids-admin/trunk/libtux4kidsadmin/studentDir.cpp 2009-08-14 22:47:29 UTC (rev 1435)
+++ tux4kids-admin/trunk/libtux4kidsadmin/studentDir.cpp 2009-08-14 22:58:00 UTC (rev 1436)
@@ -26,6 +26,11 @@
status = StudentDir::InitializationError;
return;
}
+ if (attributes->value("first_name").toString().isNull()
+ && attributes->value("last_name").toString().isNull()) {
+ status = StudentDir::InitializationError;
+ return;
+ }
loadProfileDirs();
}
More information about the Tux4kids-commits
mailing list