Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 22664 → Rev 22665

/trunk/Scribus/scribus/downloadmanager/scdlmgr.cpp
63,7 → 63,7
 
void ScDLManager::addURLs(const QStringList &urlList, bool overwrite, const QString &downloadLocation, const QString& destinationLocation)
{
foreach(const QString& s, urlList)
for(const QString& s : urlList)
{
DownloadData d;
d.id=m_dlID++;
/trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
46,7 → 46,7
QString l(QDir::cleanPath(location));
if (!l.endsWith("/"))
l += "/";
foreach (QString u, m_urlList)
for (const QString& u : m_urlList)
{
QUrl url(u);
if (!urlOK(u))
/trunk/Scribus/scribus/pageitem_latexframe.cpp
117,9 → 117,9
Q_ASSERT(!fi.fileName().isEmpty());
Q_ASSERT(!fi.fileName().contains("/"));
Q_ASSERT(!fi.fileName().contains("\\"));
QStringList files;
files = dir.entryList(filter);
foreach (const QString& file, files)
 
const QStringList files = dir.entryList(filter);
for (const QString& file : files)
{
Q_ASSERT(file.startsWith("scribus_temp"));
dir.remove(file);
465,8 → 465,8
if (relative)
{
QFileInfo fi;
QStringList configs = PrefsManager::instance()->latexConfigs();
foreach (const QString& config, configs)
const QStringList configs = PrefsManager::instance()->latexConfigs();
for (const QString& config : configs)
{
fi.setFile(config);
if (newConfig == fi.fileName())
/trunk/Scribus/scribus/prefsmanager.cpp
790,24 → 790,24
 
//Move plugin data files to new plugin data file directory
QDir oldPluginData(ScPaths::preferencesDir() + "/plugins");
QFileInfoList filPluginData(oldPluginData.entryInfoList());
foreach (const QFileInfo &fiP, filPluginData)
const QFileInfoList filPluginData(oldPluginData.entryInfoList());
for (const QFileInfo &fiP : filPluginData)
moveFile(fiP.absoluteFilePath(), ScPaths::pluginDataDir(true) + fiP.fileName());
 
//Move scrapbook files to new scrapbook directory
QDir oldScrapData(ScPaths::preferencesDir() + "/scrapbook");
QFileInfoList filScrapData(oldScrapData.entryInfoList());
foreach (const QFileInfo &fiS, filScrapData)
const QFileInfoList filScrapData(oldScrapData.entryInfoList());
for (const QFileInfo &fiS : filScrapData)
moveFile(fiS.absoluteFilePath(), ScPaths::scrapbookDir(true) + fiS.fileName());
 
//Move swatch files to new palette directory
QDir oldPaletteData(ScPaths::preferencesDir() + "/swatches");
QFileInfoList filPaletteData(oldPaletteData.entryInfoList());
foreach (const QFileInfo &fiPal, filPaletteData)
const QFileInfoList filPaletteData(oldPaletteData.entryInfoList());
for (const QFileInfo &fiPal : filPaletteData)
moveFile(fiPal.absoluteFilePath(), ScPaths::userPaletteFilesDir(true) + fiPal.fileName());
QDir oldPaletteData2=ScPaths::preferencesDir() + "/palettes";
QFileInfoList filPaletteData2(oldPaletteData2.entryInfoList());
foreach (const QFileInfo &fiPal, filPaletteData2)
QDir oldPaletteData2 = ScPaths::preferencesDir() + "/palettes";
const QFileInfoList filPaletteData2(oldPaletteData2.entryInfoList());
for (const QFileInfo &fiPal : filPaletteData2)
moveFile(fiPal.absoluteFilePath(), ScPaths::userPaletteFilesDir(true) + fiPal.fileName());
 
//Now make copies for 1.3 use and leave the old ones alone for <1.3.0 usage
1759,8 → 1759,8
dcExternalTools.setAttribute("LatexResolution", latexResolution());
dcExternalTools.setAttribute("LatexForceDpi", static_cast<int>(appPrefs.extToolPrefs.latexForceDpi));
dcExternalTools.setAttribute("LatexStartWithEmptyFrames", static_cast<int>(appPrefs.extToolPrefs.latexStartWithEmptyFrames));
QStringList configs = latexConfigs();
foreach (const QString& config, configs)
const QStringList configs = latexConfigs();
for (const QString& config : configs)
{
QDomElement domConfig = docu.createElement("LatexConfig");
domConfig.setAttribute("file", config);
/trunk/Scribus/scribus/ui/guidemanager.cpp
276,11 → 276,10
 
void GuideManager::delHorButton_clicked()
{
QModelIndexList indexes = horizontalView->selectionModel()->selectedRows(0);
QModelIndex ix;
const QModelIndexList indexes = horizontalView->selectionModel()->selectedRows(0);
Guides v;
 
foreach(ix, indexes)
for (const QModelIndex& ix : indexes)
// here *must* go EditRole due truncations in DisplayRole
// see GuidesModel::data()
v.append(horizontalModel->data(ix, Qt::EditRole).toDouble());
295,11 → 294,10
 
void GuideManager::delVerButton_clicked()
{
QModelIndexList indexes = verticalView->selectionModel()->selectedRows(0);
QModelIndex ix;
const QModelIndexList indexes = verticalView->selectionModel()->selectedRows(0);
Guides v;
 
foreach(ix, indexes)
for (const QModelIndex& ix : indexes)
// here *must* go EditRole due truncations in DisplayRole
// see GuidesModel::data()
v.append(verticalModel->data(ix, Qt::EditRole).toDouble());
440,13 → 438,12
 
Guides GuideManager::selectedHorizontals()
{
QModelIndex i;
QModelIndexList selectedIndexes = horizontalView->selectionModel()->selectedIndexes();
const QModelIndexList selectedIndexes = horizontalView->selectionModel()->selectedIndexes();
Guides ret;
Guides curr = horizontalModel->values();
foreach (i , selectedIndexes)
for (const QModelIndex& idx : selectedIndexes)
{
ret.append(curr.at(i.row()));
ret.append(curr.at(idx.row()));
}
return ret;
}
453,13 → 450,12
 
Guides GuideManager::selectedVerticals()
{
QModelIndex i;
QModelIndexList selectedIndexes = verticalView->selectionModel()->selectedIndexes();
const QModelIndexList selectedIndexes = verticalView->selectionModel()->selectedIndexes();
Guides ret;
Guides curr = verticalModel->values();
foreach (i , selectedIndexes)
for (const QModelIndex& idx : selectedIndexes)
{
ret.append(curr.at(i.row()));
ret.append(curr.at(idx.row()));
}
return ret;
}
/trunk/Scribus/scribus/ui/helpbrowser.cpp
653,12 → 653,11
{
Q_UNUSED(deselected);
 
QModelIndex index;
QModelIndexList items = selected.indexes();
int i=0;
foreach (index, items)
int i = 0;
const QModelIndexList items = selected.indexes();
for (const QModelIndex& index : items)
{
if (i==1) // skip 0, as this is always the rootitem, even if we are selecting the rootitem. hmm
if (i == 1) // skip 0, as this is always the rootitem, even if we are selecting the rootitem. hmm
{
QString filename(menuModel->data(index, Qt::DisplayRole).toString());
if (!filename.isEmpty())
/trunk/Scribus/scribus/ui/resourcemanager.cpp
1017,13 → 1017,13
qDebug()<<"Zip file doesn\'t open"<<fn;
else
{
QStringList zipFileContents(fun->files());
const QStringList zipFileContents(fun->files());
QStringList extractFiles(d.extractfiles.split(";", QString::SkipEmptyParts));
QString toDir(ScPaths::userFontDir(false)+fi.baseName()+"/");
QDir dir(ScPaths::userFontDir(false));
if (!dir.exists(fi.baseName()))
dir.mkdir(fi.baseName());
foreach (const QString& f2e, zipFileContents)
for (const QString& f2e : zipFileContents)
{
fun->extract(f2e, toDir, ScZipHandler::SkipPaths);
}
1055,13 → 1055,13
qDebug()<<"Zip file doesn\'t open"<<fn;
else
{
QStringList zipContents(fun->files());
const QStringList zipContents(fun->files());
QStringList extractFiles(d.extractfiles.split(";", QString::SkipEmptyParts));
QString toDir(ScPaths::userDictDir(static_cast<ScPaths::DictType>(fileType), false));
QDir dir(toDir);
if (dir.exists())
{
foreach (const QString& f2e, zipContents)
for (const QString& f2e : zipContents)
{
if (extractFiles.contains(f2e))
fun->extract(f2e, toDir, ScZipHandler::SkipPaths);
1101,13 → 1101,13
qDebug()<<"Zip file doesn\'t open"<<fn;
else
{
QStringList zipFileContents(fun->files());
const QStringList zipFileContents(fun->files());
QStringList extractFiles(d.extractfiles.split(";", QString::SkipEmptyParts));
QString toDir(ScPaths::userHelpFilesDir(false)+d.lang+"/");
QDir dir(ScPaths::userHelpFilesDir(false));
if (!dir.exists(d.lang))
dir.mkdir(d.lang);
foreach (const QString& f2e, zipFileContents)
for (const QString& f2e : zipFileContents)
{
//qDebug()<<"Unzipping"<<f2e<<"to"<<toDir;
fun->extract(f2e, toDir, ScZipHandler::ExtractPaths);
1219,8 → 1219,8
{
if (d.filetype=="zip")
{
QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
foreach (const QString& s, plainURLs)
const QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
for (const QString& s : plainURLs)
{
// qDebug()<<"Requesting:"<<d.url+"/"+s;
ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder, d.files);
1231,8 → 1231,8
}
if (d.filetype=="plain")
{
QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
foreach (const QString& s, plainURLs)
const QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
for (const QString& s : plainURLs)
{
ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
++dlCount;
1253,8 → 1253,8
if (d.filetype=="zip")
{
// qDebug()<<"zip type:"<<d.url<<d.files;
QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
foreach (const QString& s, plainURLs)
const QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
for (const QString& s : plainURLs)
{
ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
++dlCount;
1265,8 → 1265,8
if (d.filetype=="plain")
{
// qDebug()<<"plain type:"<<d.url<<d.files;
QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
foreach (const QString& s, plainURLs)
const QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
for (const QString& s : plainURLs)
{
ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
++dlCount;
1286,8 → 1286,8
if (d.filetype=="zip")
{
// qDebug()<<"zip type:"<<d.url<<d.files;
QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
foreach (const QString& s, plainURLs)
const QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
for (const QString& s : plainURLs)
{
ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
ScQApp->dlManager()->addURL(d.url+"/"+s+".sha256", true, ScPaths::downloadDir(), destinationFolder);
1308,8 → 1308,8
if (d.filetype=="zip")
{
// qDebug()<<"zip type:"<<d.url<<d.files;
QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
foreach (const QString& s, plainURLs)
const QStringList plainURLs(d.files.split(";", QString::SkipEmptyParts));
for (const QString& s : plainURLs)
{
ScQApp->dlManager()->addURL(d.url+"/"+s, true, ScPaths::downloadDir(), destinationFolder);
ScQApp->dlManager()->addURL(d.url+"/"+s+".sha256", true, ScPaths::downloadDir(), destinationFolder);
/trunk/Scribus/scribus/ui/smcellstyle.cpp
118,7 → 118,7
for (int i = 0; i < m_cachedStyles.count(); ++i)
cellStyles << m_cachedStyles[i];
 
foreach (const QString& styleName, styleNames)
for (const QString& styleName : styleNames)
{
int index = m_cachedStyles.find(styleName);
// FIXME: #7133: Use .isDefaultStyle() instead here rather than relying on tr text comparison
277,7 → 277,7
 
void SMCellStyle::deleteStyles(const QList<RemoveItem> &removeList)
{
foreach (const RemoveItem& removeItem, removeList)
for (const RemoveItem& removeItem : removeList)
{
for (int i = 0; i < m_selection.count(); ++i)
{
/trunk/Scribus/scribus/ui/smtablestyle.cpp
114,7 → 114,7
for (int i = 0; i < m_cachedStyles.count(); ++i)
tableStyles << m_cachedStyles[i];
 
foreach (const QString& styleName, styleNames)
for (const QString& styleName : styleNames)
{
int index = m_cachedStyles.find(styleName);
// FIXME: #7133: Use .isDefaultStyle() instead here rather than relying on tr text comparison
273,7 → 273,7
 
void SMTableStyle::deleteStyles(const QList<RemoveItem> &removeList)
{
foreach (const RemoveItem& removeItem, removeList)
for (const RemoveItem& removeItem : removeList)
{
for (int i = 0; i < m_selection.count(); ++i)
{