View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0017879 | Scribus | General | public | 2026-07-06 11:22 | 2026-07-06 11:30 |
| Reporter | qirat | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | new | Resolution | open | ||
| Platform | Linux | OS | Fedora Workstation | OS Version | 44 |
| Product Version | 1.7.4.svn | ||||
| Summary | 0017879: Small warning cleanup (pageitem_osgframe) | ||||
| Description | First thing first, this was created using AI. When compiling, I regularly see these warnings that are harmless anyway but I thought why not just try to cleanup. So I asked an AI to target only the ones that would go away with minimal code changes, and it created me the attached patch. I tested it and those specific warnings were gone when I recompiled. This is very short so it should not be very time consuming for you, devs. | ||||
| Additional Information | I appologise in advance if the patch is not as per Scribus standards or any other mistakes. I hope it hepls. | ||||
| Tags | No tags attached. | ||||
| Attached Files | scribus-warning-cleanup.patch (2,167 bytes)
Index: scribus/pageitem_osgframe.cpp
===================================================================
--- scribus/pageitem_osgframe.cpp (revision 0)
+++ scribus/pageitem_osgframe.cpp (working copy)
@@ -110,7 +110,11 @@ void PageItem_OSGFrame::setImage(QImage &image)
QTemporaryFile *tempFile = new QTemporaryFile(QDir::tempPath() + "/scribus_temp_osg_XXXXXX.png");
tempFile->setAutoRemove(false);
- tempFile->open();
+ if (!tempFile->open())
+ {
+ delete tempFile;
+ return;
+ }
QString imgName = getLongPathName(tempFile->fileName());
tempFile->close();
image.save(imgName, "PNG");
Index: scribus/ui/charselect.cpp
===================================================================
--- scribus/ui/charselect.cpp (revision 0)
+++ scribus/ui/charselect.cpp (working copy)
@@ -91,13 +91,20 @@ CharSelect::~CharSelect()
void CharSelect::userNewChar(uint i, const QString& font)
{
- QString str = QString::fromUcs4(&i, 1);
+ const char32_t ch = static_cast<char32_t>(i);
+ QString str = QString::fromUcs4(&ch, 1);
emit insertUserSpecialChar(str, font);
}
void CharSelect::slot_insertSpecialChars(const QVector<uint> & chars)
{
- chToIns = QString::fromUcs4(chars.data(), chars.length());
+ QVector<char32_t> ucs4Chars;
+ ucs4Chars.reserve(chars.size());
+ for (uint ch : chars)
+ ucs4Chars.append(static_cast<char32_t>(ch));
+
+ chToIns = QString::fromUcs4(ucs4Chars.constData(), ucs4Chars.size());
slot_insertSpecialChar();
}
Index: scribus/ui/smpstylewidget.cpp
===================================================================
--- scribus/ui/smpstylewidget.cpp (revision 0)
+++ scribus/ui/smpstylewidget.cpp (working copy)
@@ -881,7 +881,13 @@ void SMPStyleWidget::handleParEffectUseDropCap()
void SMPStyleWidget::insertSpecialChars(const QVector<uint> &charCodes)
{
- QString chars = QString::fromUcs4(charCodes.data(), charCodes.length());
+ QVector<char32_t> ucs4Chars;
+ ucs4Chars.reserve(charCodes.size());
+ for (uint ch : charCodes)
+ ucs4Chars.append(static_cast<char32_t>(ch));
+
+ QString chars = QString::fromUcs4(ucs4Chars.constData(), ucs4Chars.size());
bulletStrEdit->lineEdit()->setText(chars);
}
| ||||
| Patch | Yes | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-07-06 11:22 | qirat | New Issue | |
| 2026-07-06 11:22 | qirat | File Added: scribus-warning-cleanup.patch | |
| 2026-07-06 11:30 | qirat | Note Added: 0053987 | |
| 2026-07-06 11:30 | qirat | File Added: warnings3.png | |
| 2026-07-06 11:30 | qirat | File Added: warnings2.png | |
| 2026-07-06 11:30 | qirat | File Added: warnings1.png |