删除多余磁盘空间判断,微调缓存设置
This commit is contained in:
parent
dcd5734cb8
commit
116c9e1dd3
|
@ -35,9 +35,8 @@ QString Dialog_ClrCache::getCachePath()
|
|||
HGBase_GetProcessName(procName, 512);
|
||||
strcat(cachePath, procName);
|
||||
strcat(cachePath, "/Cache/");
|
||||
QString filePath = getStdFileName(StdStringToUtf8(cachePath).c_str());
|
||||
|
||||
return getCfgValue("save", "cachePath", QString(filePath));
|
||||
return getCfgValue("save", "cachePath", getStdFileName(StdStringToUtf8(cachePath).c_str()));
|
||||
}
|
||||
|
||||
void Dialog_ClrCache::on_btn_clr_clicked()
|
||||
|
@ -156,14 +155,14 @@ void Dialog_ClrCache::on_btn_directory_clicked()
|
|||
|
||||
void Dialog_ClrCache::on_pbtn_ok_clicked()
|
||||
{
|
||||
if (ui->lineEdit->text().endsWith(getStdFileName(QString("/Cache/")), Qt::CaseInsensitive))
|
||||
if (ui->lineEdit->text().endsWith(getStdFileName(QString("Cache/")), Qt::CaseInsensitive))
|
||||
{
|
||||
saveCfgValue("save", "cachePath", ui->lineEdit->text());
|
||||
saveCfgValue("save", "cachePath", getStdFileName(ui->lineEdit->text()));
|
||||
}
|
||||
else
|
||||
{
|
||||
QString filePath = ui->lineEdit->text() + "/Cache/";
|
||||
HGResult ret = HGBase_CreateDir(filePath.toStdString().c_str());
|
||||
QString filePath = ui->lineEdit->text() + "Cache/";
|
||||
HGResult ret = HGBase_CreateDir(getStdString(filePath).c_str());
|
||||
if (ret != HGBASE_ERR_OK)
|
||||
{
|
||||
QString str = m_mainWindow->getLogInfo(ret);
|
||||
|
|
|
@ -1258,11 +1258,6 @@ void MainWindow::on_continueScan()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!startSpaceCheck(m_dialogLog))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
startSaveMessageBox(m_dialogLog);
|
||||
|
||||
SANE_Status ret;
|
||||
|
@ -1676,39 +1671,6 @@ askIfClear MainWindow::startScanMessageBox(QWidget *parent)
|
|||
return notClearAndScan;
|
||||
}
|
||||
|
||||
bool MainWindow::startSpaceCheck(QWidget* parent)
|
||||
{
|
||||
qint64 space = 0;
|
||||
|
||||
QList<QStorageInfo> storageInfoList = QStorageInfo::mountedVolumes();
|
||||
foreach(QStorageInfo storage, storageInfoList)
|
||||
{
|
||||
QString savePath;
|
||||
if (1 == m_scanType)
|
||||
savePath = Dialog_ClrCache::getCachePath();
|
||||
else if (2 == m_scanType)
|
||||
savePath = m_aquireIntoSaveParam.m_savePath;
|
||||
if (0 == savePath.indexOf(getStdFileName(storage.rootPath())))
|
||||
{
|
||||
space = storage.bytesAvailable() / 1024 / 1024;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
assert(0 != space);
|
||||
if (space < 64)
|
||||
{
|
||||
HGBase_WriteInfo(HGBASE_INFOTYPE_ERROR, "disk space is unsufficient!");
|
||||
QMessageBox msg(QMessageBox::Information, tr("Information"),
|
||||
tr("Insufficient disk space"), QMessageBox::Yes, parent);
|
||||
msg.setButtonText(QMessageBox::Yes, tr("yes"));
|
||||
msg.exec();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QString MainWindow::passwordEncrypt(const QString& password)
|
||||
{
|
||||
QString p = password;
|
||||
|
@ -3150,12 +3112,6 @@ void MainWindow::on_act_acquire_triggered()
|
|||
m_scanType = 1;
|
||||
m_scanInsertPos = -1;
|
||||
|
||||
if (!startSpaceCheck(this))
|
||||
{
|
||||
m_dialogLog->updateStatus(dev_que_.is_online() && 0 != m_scanType, m_isScanning);
|
||||
return;
|
||||
}
|
||||
|
||||
startSaveMessageBox(this);
|
||||
|
||||
m_dpi = getDpi();
|
||||
|
@ -3223,12 +3179,6 @@ void MainWindow::on_act_acquireSingle_triggered()
|
|||
m_scanType = 1;
|
||||
m_scanInsertPos = -1;
|
||||
|
||||
if (!startSpaceCheck(this))
|
||||
{
|
||||
m_dialogLog->updateStatus(dev_que_.is_online() && 0 != m_scanType, m_isScanning);
|
||||
return;
|
||||
}
|
||||
|
||||
startSaveMessageBox(this);
|
||||
|
||||
m_dpi = getDpi();
|
||||
|
@ -3312,12 +3262,6 @@ void MainWindow::on_act_acquireInto_triggered()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!startSpaceCheck(this))
|
||||
{
|
||||
m_dialogLog->updateStatus(dev_que_.is_online() && 0 != m_scanType, m_isScanning);
|
||||
return;
|
||||
}
|
||||
|
||||
startSaveMessageBox(this);
|
||||
|
||||
m_dpi = getDpi();
|
||||
|
@ -3400,12 +3344,6 @@ void MainWindow::on_act_insertFromScanner_triggered()
|
|||
break;
|
||||
}
|
||||
|
||||
if (!startSpaceCheck(this))
|
||||
{
|
||||
m_dialogLog->updateStatus(dev_que_.is_online() && 0 != m_scanType, m_isScanning);
|
||||
return;
|
||||
}
|
||||
|
||||
startSaveMessageBox(this);
|
||||
|
||||
m_dpi = getDpi();
|
||||
|
|
|
@ -256,7 +256,6 @@ private:
|
|||
void updateActionStatus();
|
||||
void startSaveMessageBox(QWidget* parent);
|
||||
askIfClear startScanMessageBox(QWidget* parent);
|
||||
bool startSpaceCheck(QWidget* parent);
|
||||
QString passwordEncrypt(const QString& password);
|
||||
QString passwordDecrypt(const QString& transcode);
|
||||
bool open_scanner(const QString& name, const QString& scheme);
|
||||
|
|
Loading…
Reference in New Issue