Renamed path_open() -> path_streamopen()

This commit is contained in:
Jean-Francois Dockes
2020-09-29 13:35:55 +02:00
parent 4b928ee57e
commit 19eac2d7dc
11 changed files with 40 additions and 52 deletions
+1 -1
View File
@@ -234,7 +234,7 @@ bool RclMain::maybeArgsToFile(vector<string>& args)
string s;
stringsToString(args, s);
fstream fout;
if (!path_open(m_idxargstmp->filename(), ios::out|ios::trunc, fout)) {
if (!path_streamopen(m_idxargstmp->filename(), ios::out|ios::trunc, fout)) {
QMessageBox::warning(
0, "Recoll", tr("Could not start recollindex (temp file error)"));
return false;
+2 -2
View File
@@ -1158,8 +1158,8 @@ void RclMain::exportSimpleSearchHistory()
}
string path = qs2utf8s(dialog.selectedFiles().value(0));
LOGDEB("Chosen path: " << path << "\n");
std::fstream fp = path_open(path, std::ios::out | std::ios::trunc);
if (!fp.is_open()) {
std::fstream fp;
if (!path_streamopen(path, std::ios::out | std::ios::trunc, fp)) {
QMessageBox::warning(0, "Recoll", tr("Could not open/create file"));
return;
}
+2 -2
View File
@@ -807,8 +807,8 @@ void ResTable::saveAsCSV()
if (s.isEmpty())
return;
std::string tofile = qs2path(s);
std::fstream fp = path_open(tofile, std::ios::out|std::ios::trunc);
if (!fp.is_open()) {
std::fstream fp;
if (!path_streamopen(tofile, std::ios::out|std::ios::trunc,fp)) {
QMessageBox::warning(0, "Recoll",
tr("Can't open/create file: ") + s);
return;
+12 -6
View File
@@ -36,9 +36,9 @@ using namespace std;
void WinSchedToolW::init()
{
if (!theconfig) {
QMessageBox::warning(0, tr("Error"),
tr("Configuration not initialized"));
return;
QMessageBox::warning(0, tr("Error"),
tr("Configuration not initialized"));
return;
}
connect(startPB, SIGNAL(clicked()), this, SLOT(startWinScheduler()));
@@ -55,9 +55,15 @@ void WinSchedToolW::init()
LOGDEB("WinSchedTool: batch file " << batchfile << endl);
if (!path_exists(batchfile)) {
std::fstream fp = path_open(batchfile, ios::out|ios::trunc);
fp << "\"" << recollindex << "\" -c \"" << confdir << "\"\n";
fp.close();
std::fstream fp;
if (path_streamopen(batchfile, ios::out|ios::trunc, fp)) {
fp << "\"" << recollindex << "\" -c \"" << confdir << "\"\n";
fp.close();
} else {
QMessageBox::warning(0, tr("Error"),
tr("Could not create batch file"));
return;
}
}
QString blurb = tr(
"<h3>Recoll indexing batch scheduling</h3>"