Permalink
Browse files

:], Fix bug in session

  • Loading branch information...
1 parent ef0881e commit 276cbf5f5e1a7b90fd42c3ec11b73af14d23fe7b @nycholas committed Jun 21, 2010
View
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: c-project
-# Generated by qmake (2.01a) (Qt 4.6.3) on: Mon Jun 21 12:05:49 2010
+# Generated by qmake (2.01a) (Qt 4.6.3) on: Mon Jun 21 18:10:15 2010
# Project: c-project.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile c-project.pro
@@ -215,7 +215,7 @@ qmake: FORCE
dist:
@$(CHK_DIR_EXISTS) .tmp/c-project1.0.0 || $(MKDIR) .tmp/c-project1.0.0
- $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/c-project1.0.0/ && $(COPY_FILE) --parents apps/changepassword.h apps/contenttypes.h apps/contenttypesform.h apps/contenttypesmodel.h apps/contenttypessearch.h apps/group.h apps/groupform.h apps/groupmodel.h apps/groupsearch.h apps/login.h apps/mainwindow.h apps/permission.h apps/permissionform.h apps/permissionmodel.h apps/permissionsearch.h apps/user.h apps/userform.h apps/usermodel.h apps/usersearch.h commons/connection.h db/connection.h .tmp/c-project1.0.0/ && $(COPY_FILE) --parents resources/ui/resources.qrc .tmp/c-project1.0.0/ && $(COPY_FILE) --parents main.cpp apps/changepassword.cpp apps/contenttypes.cpp apps/contenttypesform.cpp apps/contenttypesmodel.cpp apps/contenttypessearch.cpp apps/group.cpp apps/groupform.cpp apps/groupmodel.cpp apps/groupsearch.cpp apps/login.cpp apps/mainwindow.cpp apps/permission.cpp apps/permissionform.cpp apps/permissionmodel.cpp apps/permissionsearch.cpp apps/user.cpp apps/userform.cpp apps/usermodel.cpp apps/usersearch.cpp .tmp/c-project1.0.0/ && $(COPY_FILE) --parents resources/ui/changepassword.ui resources/ui/contenttypes.ui resources/ui/contenttypesform.ui resources/ui/contenttypessearch.ui resources/ui/group.ui resources/ui/groupform.ui resources/ui/groupsearch.ui resources/ui/login.ui resources/ui/mainwindow.ui resources/ui/permission.ui resources/ui/permissionform.ui resources/ui/permissionsearch.ui resources/ui/user.ui resources/ui/userform.ui resources/ui/usersearch.ui .tmp/c-project1.0.0/ && (cd `dirname .tmp/c-project1.0.0` && $(TAR) c-project1.0.0.tar c-project1.0.0 && $(COMPRESS) c-project1.0.0.tar) && $(MOVE) `dirname .tmp/c-project1.0.0`/c-project1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/c-project1.0.0
+ $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/c-project1.0.0/ && $(COPY_FILE) --parents apps/changepassword.h apps/contenttypes.h apps/contenttypesform.h apps/contenttypesmodel.h apps/contenttypessearch.h apps/group.h apps/groupform.h apps/groupmodel.h apps/groupsearch.h apps/login.h apps/mainwindow.h apps/permission.h apps/permissionform.h apps/permissionmodel.h apps/permissionsearch.h apps/user.h apps/userform.h apps/usermodel.h apps/usersearch.h commons/connection.h .tmp/c-project1.0.0/ && $(COPY_FILE) --parents resources/ui/resources.qrc .tmp/c-project1.0.0/ && $(COPY_FILE) --parents main.cpp apps/changepassword.cpp apps/contenttypes.cpp apps/contenttypesform.cpp apps/contenttypesmodel.cpp apps/contenttypessearch.cpp apps/group.cpp apps/groupform.cpp apps/groupmodel.cpp apps/groupsearch.cpp apps/login.cpp apps/mainwindow.cpp apps/permission.cpp apps/permissionform.cpp apps/permissionmodel.cpp apps/permissionsearch.cpp apps/user.cpp apps/userform.cpp apps/usermodel.cpp apps/usersearch.cpp .tmp/c-project1.0.0/ && $(COPY_FILE) --parents resources/ui/changepassword.ui resources/ui/contenttypes.ui resources/ui/contenttypesform.ui resources/ui/contenttypessearch.ui resources/ui/group.ui resources/ui/groupform.ui resources/ui/groupsearch.ui resources/ui/login.ui resources/ui/mainwindow.ui resources/ui/permission.ui resources/ui/permissionform.ui resources/ui/permissionsearch.ui resources/ui/user.ui resources/ui/userform.ui resources/ui/usersearch.ui .tmp/c-project1.0.0/ && (cd `dirname .tmp/c-project1.0.0` && $(TAR) c-project1.0.0.tar c-project1.0.0 && $(COMPRESS) c-project1.0.0.tar) && $(MOVE) `dirname .tmp/c-project1.0.0`/c-project1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/c-project1.0.0
clean:compiler_clean
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
@@ -55,7 +55,7 @@ void Login::accept(void) {
QString password = passwordLineEdit->text();
if (username == "admin" && password == "admin") {
qDebug() << " :: Loging: OK";
- QSettings settings("Cenobites Technology", "cproject");
+ QSettings settings("Cenobites Technology", "c-project");
settings.beginGroup("session");
settings.setValue("isAuthentic", true);
settings.setValue("username", username);
@@ -65,7 +65,7 @@ void Login::accept(void) {
QDialog::accept();
} else {
qDebug() << " :: Loging: FALSE";
- QSettings settings("Cenobites Technology", "cproject");
+ QSettings settings("Cenobites Technology", "c-project");
settings.beginGroup("session");
settings.setValue("isAuthentic", false);
settings.setValue("usename", qApp->tr("Annonymous"));
@@ -80,7 +80,7 @@ void Login::accept(void) {
void Login::readSettings(void) {
qDebug() << "In Login::readSettings()";
- QSettings settings("Cenobites Technology", "cproject");
+ QSettings settings("Cenobites Technology", "c-project");
settings.beginGroup("login");
resize(settings.value("size", QSize(387, 250)).toSize());
move(settings.value("pos", QPoint(200, 200)).toPoint());
@@ -89,7 +89,7 @@ void Login::readSettings(void) {
void Login::writeSettings(void) {
qDebug() << "In Login::writeSettings()";
- QSettings settings("Cenobites Technology", "cproject");
+ QSettings settings("Cenobites Technology", "c-project");
settings.beginGroup("login");
settings.setValue("size", size());
settings.setValue("pos", pos());
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
@@ -57,7 +57,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
void MainWindow::isAuthentic(void) {
qDebug() << "In MainWindow::isAuthentic()";
- QSettings settings("Cenobites Technology", "cproject");
+ QSettings settings("Cenobites Technology", "c-project");
bool isAuthentic = settings.value("session/isAuthentic", false).toBool();
if (!isAuthentic) {
if (LoginObj().exec() == QDialog::Accepted) {
@@ -76,7 +76,7 @@ void MainWindow::changePassword(void) {
void MainWindow::logout(void) {
qDebug() << "In MainWindow::logout()";
- QSettings settings("Cenobites Technology", "cproject");
+ QSettings settings("Cenobites Technology", "c-project");
settings.setValue("session/isAuthentic", false);
if (LoginObj().exec() == QDialog::Rejected) {
close();
@@ -86,7 +86,7 @@ void MainWindow::logout(void) {
void MainWindow::readSettings(void) {
qDebug() << "In MainWindow::readSettings()";
- QSettings settings("Cenobites Technology", "cproject");
+ QSettings settings("Cenobites Technology", "c-project");
settings.beginGroup("mainwindow");
resize(settings.value("size", QSize(800, 600)).toSize());
move(settings.value("pos", QPoint(200, 200)).toPoint());
@@ -95,7 +95,7 @@ void MainWindow::readSettings(void) {
void MainWindow::writeSettings(void) {
qDebug() << "In MainWindow::writeSettings()";
- QSettings settings("Cenobites Technology", "cproject");
+ QSettings settings("Cenobites Technology", "c-project");
settings.beginGroup("mainwindow");
settings.setValue("size", size());
settings.setValue("pos", pos());
@@ -123,8 +123,8 @@ void MainWindow::createActions(void) {
void MainWindow::updateWidgets(void) {
qDebug() << "In MainWindow::updateWidgets()";
- QSettings settings("Cenobites Technology", "cproject");
- QString username = settings.value("system/username").toString();
+ QSettings settings("Cenobites Technology", "c-project");
+ QString username = settings.value("session/username").toString();
welcomeLabel->setText(
QString(qApp->tr("Welcome, <b>%1</b>.")).arg(username));
}
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
View
BIN c-project
Binary file not shown.
View
@@ -1,12 +1,12 @@
######################################################################
-# Automatically generated by qmake (2.01a) Mon Jun 21 12:05:44 2010
+# Automatically generated by qmake (2.01a) Mon Jun 21 18:10:14 2010
######################################################################
QT += sql
UI_DIR = apps/widgets
TEMPLATE = app
TARGET =
-DEPENDPATH += . apps commons db resources/ui
+DEPENDPATH += . apps commons resources/ui
INCLUDEPATH += . commons apps
# Input
@@ -29,8 +29,7 @@ HEADERS += apps/changepassword.h \
apps/userform.h \
apps/usermodel.h \
apps/usersearch.h \
- commons/connection.h \
- db/connection.h
+ commons/connection.h
FORMS += resources/ui/changepassword.ui \
resources/ui/contenttypes.ui \
resources/ui/contenttypesform.ui \
View
@@ -54,7 +54,7 @@
static bool createConnection(void) {
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("localhost");
- db.setDatabaseName("appdb");
+ db.setDatabaseName("cproject");
db.setUserName("root");
db.setPassword("1q2w3e");
if (!db.open()) {
@@ -72,7 +72,7 @@ static bool createConnection(void) {
static void closeConnection(void) {
QSqlDatabase db = QSqlDatabase::database();
if (db.open()) {
- db.removeDatabase("appdb");
+ db.removeDatabase("cproject");
db.close();
}
}
View
@@ -1,5 +1,5 @@
/**
- * cproject - a digital registry.
+ * c-project - a digital registry.
* Copyright (c) 2010, Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
* All rights reserved.
*
@@ -41,7 +41,7 @@ int main(int argc, char *argv[]) {
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
QCoreApplication::setOrganizationName("Cenobites Technology");
QCoreApplication::setOrganizationDomain("cenobitestechnology.org");
- QCoreApplication::setApplicationName("cproject");
+ QCoreApplication::setApplicationName("c-project");
qDebug() << " :: Create connection...";
if (!createConnection()) {
qDebug() << " !! Connection failed! ";

0 comments on commit 276cbf5

Please sign in to comment.