diff --git a/YACReaderLibrary/server/lib/bfHttpServer/httpconnectionhandlerpool.cpp b/YACReaderLibrary/server/lib/bfHttpServer/httpconnectionhandlerpool.cpp index 3aa00a4d..fbf70b49 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/httpconnectionhandlerpool.cpp +++ b/YACReaderLibrary/server/lib/bfHttpServer/httpconnectionhandlerpool.cpp @@ -6,7 +6,7 @@ HttpConnectionHandlerPool::HttpConnectionHandlerPool(QSettings* settings, HttpRe Q_ASSERT(settings!=0); this->settings=settings; this->requestHandler=requestHandler; - cleanupTimer.start(settings->value("cleanupInterval",1000).toInt()); + cleanupTimer.start(settings->value("cleanupInterval",10000).toInt()); connect(&cleanupTimer, SIGNAL(timeout()), SLOT(cleanup())); } @@ -32,7 +32,7 @@ HttpConnectionHandler* HttpConnectionHandlerPool::getConnectionHandler() { } // create a new handler, if necessary if (!freeHandler) { - int maxConnectionHandlers=settings->value("maxThreads",100).toInt(); + int maxConnectionHandlers=settings->value("maxThreads",1000).toInt(); if (pool.count()setBusy(); @@ -46,7 +46,7 @@ HttpConnectionHandler* HttpConnectionHandlerPool::getConnectionHandler() { void HttpConnectionHandlerPool::cleanup() { - int maxIdleHandlers=settings->value("minThreads",1).toInt(); + int maxIdleHandlers=settings->value("minThreads",50).toInt(); int idleCounter=0; mutex.lock(); foreach(HttpConnectionHandler* handler, pool) { diff --git a/YACReaderLibrary/server/lib/bfHttpServer/httplistener.cpp b/YACReaderLibrary/server/lib/bfHttpServer/httplistener.cpp index 107d1e71..da26376f 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/httplistener.cpp +++ b/YACReaderLibrary/server/lib/bfHttpServer/httplistener.cpp @@ -14,7 +14,7 @@ HttpListener::HttpListener(QSettings* settings, HttpRequestHandler* requestHandl Q_ASSERT(settings!=0); this->settings=settings; // Start listening - int port=settings->value("port").toInt(); + int port=settings->value("port",8080).toInt(); listen(QHostAddress::Any, port); //Cambiado int i = 0; diff --git a/YACReaderLibrary/server/lib/bfHttpServer/httprequest.cpp b/YACReaderLibrary/server/lib/bfHttpServer/httprequest.cpp index 520f48ea..b91cb817 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/httprequest.cpp +++ b/YACReaderLibrary/server/lib/bfHttpServer/httprequest.cpp @@ -12,7 +12,7 @@ HttpRequest::HttpRequest(QSettings* settings) { status=waitForRequest; currentSize=0; expectedBodySize=0; - maxSize=settings->value("maxRequestSize","16000").toInt(); + maxSize=settings->value("maxRequestSize","16000000").toInt(); maxMultiPartSize=settings->value("maxMultiPartSize","1000000").toInt(); } diff --git a/YACReaderLibrary/server/lib/bfHttpServer/httpsessionstore.cpp b/YACReaderLibrary/server/lib/bfHttpServer/httpsessionstore.cpp index 5eb281aa..b37ee1d5 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/httpsessionstore.cpp +++ b/YACReaderLibrary/server/lib/bfHttpServer/httpsessionstore.cpp @@ -14,7 +14,7 @@ HttpSessionStore::HttpSessionStore(QSettings* settings, QObject* parent) connect(&cleanupTimer,SIGNAL(timeout()),this,SLOT(timerEvent())); cleanupTimer.start(60000); cookieName=settings->value("cookieName","sessionid").toByteArray(); - expirationTime=settings->value("expirationTime",3600000).toInt(); + expirationTime=settings->value("expirationTime",18000000).toInt(); qDebug("HttpSessionStore: Sessions expire after %i milliseconds",expirationTime); } @@ -57,7 +57,7 @@ HttpSession HttpSessionStore::getSession(HttpRequest& request, HttpResponse& res // Need to create a new session if (allowCreate) { QByteArray cookieName=settings->value("cookieName","sessionid").toByteArray(); - QByteArray cookiePath=settings->value("cookiePath").toByteArray(); + QByteArray cookiePath=settings->value("cookiePath","/").toByteArray(); QByteArray cookieComment=settings->value("cookieComment").toByteArray(); QByteArray cookieDomain=settings->value("cookieDomain").toByteArray(); HttpSession session(true); diff --git a/YACReaderLibrary/server/lib/bfHttpServer/staticfilecontroller.cpp b/YACReaderLibrary/server/lib/bfHttpServer/staticfilecontroller.cpp index cef61697..1a7b29ce 100644 --- a/YACReaderLibrary/server/lib/bfHttpServer/staticfilecontroller.cpp +++ b/YACReaderLibrary/server/lib/bfHttpServer/staticfilecontroller.cpp @@ -15,7 +15,7 @@ StaticFileController::StaticFileController(QSettings* settings, QObject* parent) { maxAge=settings->value("maxAge","60000").toInt(); encoding=settings->value("encoding","UTF-8").toString(); - docroot=settings->value("path",".").toString(); + docroot=settings->value("path","./server/docroot").toString(); // Convert relative path to absolute, based on the directory of the config file. #ifdef Q_OS_WIN32 if (QDir::isRelativePath(docroot) && settings->format()!=QSettings::NativeFormat) diff --git a/YACReaderLibrary/server/lib/bfTemplateEngine/templatecache.cpp b/YACReaderLibrary/server/lib/bfTemplateEngine/templatecache.cpp index 9073e34b..823f4f24 100644 --- a/YACReaderLibrary/server/lib/bfTemplateEngine/templatecache.cpp +++ b/YACReaderLibrary/server/lib/bfTemplateEngine/templatecache.cpp @@ -6,7 +6,7 @@ TemplateCache::TemplateCache(QSettings* settings, QObject* parent) :TemplateLoader(settings,parent) { - cache.setMaxCost(settings->value("cacheSize","1000000").toInt()); + cache.setMaxCost(settings->value("cacheSize","160000").toInt());//este tamaņo antes era 1000000 cacheTimeout=settings->value("cacheTime","60000").toInt(); qDebug("TemplateCache: timeout=%i, size=%i",cacheTimeout,cache.maxCost()); } diff --git a/YACReaderLibrary/server/lib/bfTemplateEngine/templateloader.cpp b/YACReaderLibrary/server/lib/bfTemplateEngine/templateloader.cpp index 33ba7d02..121b00de 100644 --- a/YACReaderLibrary/server/lib/bfTemplateEngine/templateloader.cpp +++ b/YACReaderLibrary/server/lib/bfTemplateEngine/templateloader.cpp @@ -13,7 +13,7 @@ TemplateLoader::TemplateLoader(QSettings* settings, QObject* parent) : QObject(parent) { - templatePath=settings->value("path",".").toString(); + templatePath=settings->value("path","./server/templates").toString(); // Convert relative path to absolute, based on the directory of the config file. #ifdef Q_OS_WIN32 if (QDir::isRelativePath(templatePath) && settings->format()!=QSettings::NativeFormat) @@ -25,7 +25,7 @@ TemplateLoader::TemplateLoader(QSettings* settings, QObject* parent) templatePath=QFileInfo(configFile.absolutePath(),templatePath).absoluteFilePath(); } fileNameSuffix=settings->value("suffix",".tpl").toString(); - QString encoding=settings->value("encoding").toString(); + QString encoding=settings->value("encoding","UTF-8").toString(); if (encoding.isEmpty()) { textCodec=QTextCodec::codecForLocale(); } diff --git a/common/custom_widgets.cpp b/common/custom_widgets.cpp index bbcc909c..e39f7d59 100644 --- a/common/custom_widgets.cpp +++ b/common/custom_widgets.cpp @@ -513,7 +513,7 @@ void YACReaderFieldPlainTextEdit::setDisabled(bool disabled) ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// YACReaderSpinSliderWidget::YACReaderSpinSliderWidget(QWidget * parent,bool strechableSlider) - :QWidget(parent) + :QWidget(parent),tracking(true) { QHBoxLayout * layout = new QHBoxLayout; layout->addWidget(label = new QLabel(this),1); @@ -533,10 +533,30 @@ YACReaderSpinSliderWidget::YACReaderSpinSliderWidget(QWidget * parent,bool strec connect(spinBox, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int))); connect(slider, SIGNAL(valueChanged(int)), spinBox, SLOT(setValue(int))); - connect(spinBox, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged(int))); + connect(slider, SIGNAL(valueChanged(int)), this, SLOT(valueWillChange(int))); + connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(valueWillChangeFromSpinBox(int))); + + connect(slider, SIGNAL(sliderReleased()), this, SLOT(sliderRelease())); setLayout(layout); } +void YACReaderSpinSliderWidget::valueWillChange(int v) +{ + if(tracking) + emit valueChanged(spinBox->value()); +} + +void YACReaderSpinSliderWidget::valueWillChangeFromSpinBox(int v) +{ + if(!tracking && !slider->isSliderDown()) + emit valueChanged(spinBox->value()); +} + +void YACReaderSpinSliderWidget::sliderRelease() +{ + if(!tracking) + emit valueChanged(spinBox->value()); +} void YACReaderSpinSliderWidget::setRange(int lowValue, int topValue, int step) { @@ -551,9 +571,9 @@ void YACReaderSpinSliderWidget::setRange(int lowValue, int topValue, int step) void YACReaderSpinSliderWidget::setValue(int value) { - disconnect(spinBox, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged(int))); + disconnect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(valueWillChange(int))); spinBox->setValue(value); - connect(spinBox, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged(int))); + connect(spinBox, SIGNAL(valueChanged(int)), this, SLOT(valueWillChange(int))); } void YACReaderSpinSliderWidget::setText(const QString & text) @@ -573,7 +593,8 @@ QSize YACReaderSpinSliderWidget::minimumSizeHint() const void YACReaderSpinSliderWidget::setTracking(bool b) { - slider->setTracking(b); + tracking = b; + //slider->setTracking(b); } ////////////////////////////////////////////////////////////////////////// diff --git a/common/custom_widgets.h b/common/custom_widgets.h index a95cf225..7040f4b1 100644 --- a/common/custom_widgets.h +++ b/common/custom_widgets.h @@ -248,6 +248,7 @@ private: QLabel * label; QSpinBox * spinBox; QSlider * slider; + bool tracking; public: YACReaderSpinSliderWidget(QWidget * parent = 0,bool strechableSlider = false); public slots: @@ -257,6 +258,9 @@ public slots: int getValue(); QSize minimumSizeHint() const; void setTracking(bool b); + void valueWillChange(int); + void valueWillChangeFromSpinBox(int); + void sliderRelease(); signals: void valueChanged(int);