A?adidos los par?metros por defecto correctos para el servidor.

Corregidos los sliders de las opciones de imagen
This commit is contained in:
Luis Ángel San Martín 2013-04-09 17:49:49 +02:00
parent 88c99a390b
commit a3a555cc93
9 changed files with 41 additions and 16 deletions

View File

@ -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()<maxConnectionHandlers) {
freeHandler=new HttpConnectionHandler(settings,requestHandler);
freeHandler->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) {

View File

@ -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;

View File

@ -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();
}

View File

@ -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);

View File

@ -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)

View File

@ -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());
}

View File

@ -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();
}

View File

@ -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);
}
//////////////////////////////////////////////////////////////////////////

View File

@ -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);