summaryrefslogtreecommitdiff
path: root/client/widgets/dbwidget.cc
diff options
context:
space:
mode:
authordeva <deva>2008-09-08 14:10:08 +0000
committerdeva <deva>2008-09-08 14:10:08 +0000
commit9ed90a1ee0f9605d197f95f9234b40ad6a9b9084 (patch)
tree289a4466a419f7fa3bccc4546ad103e429762457 /client/widgets/dbwidget.cc
parentf85025ffc6dca58e87b2cb2cc3522a987b519ad8 (diff)
Added timeout. Fixed setValue/getValue functions.
Diffstat (limited to 'client/widgets/dbwidget.cc')
-rw-r--r--client/widgets/dbwidget.cc19
1 files changed, 4 insertions, 15 deletions
diff --git a/client/widgets/dbwidget.cc b/client/widgets/dbwidget.cc
index 1c0a0d2..1a68d2a 100644
--- a/client/widgets/dbwidget.cc
+++ b/client/widgets/dbwidget.cc
@@ -64,6 +64,7 @@ DBWidget::DBWidget(QDomNode &node, MacroWindow *macrowindow)
db.setDatabaseName(elem.attribute("database"));
db.setUserName(elem.attribute("user"));
if(elem.hasAttribute("password")) db.setPassword(elem.attribute("password"));
+ db.setConnectOptions("connect_timeout=2000");
bool ok = db.open();
if(!ok) {
printf("DB connect failed!\n");
@@ -102,26 +103,14 @@ QString DBWidget::getValue()
{
QString value;
- int idx = currentIndex();
-
- if(idx != -1 && itemText(idx) == currentText()) value = itemData(idx).toString();
- else value = currentText();
+ value = currentText();
return value;
}
-/*
-void DBWidget::focusInEvent(QFocusEvent *)
-{
- if(currentText() == "Skriv noget i søgefeltet.") {
- setEditText("");
- }
-}
-*/
+
void DBWidget::setValue(QString value)
{
- int idx = findData(value);
-
- if(idx != -1) setCurrentIndex(idx);
+ setEditText(value);
}
bool DBWidget::isValid()