r24887 by craig - Qt6: code cleanup

scribus-commit scribus-commit at lists.scribus.net
Thu Feb 3 20:45:13 UTC 2022


Author: craig
Date: Thu Feb  3 20:45:13 2022
New Revision: 24887

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24887
Log:
Qt6: code cleanup

Modified:
    trunk/Scribus/scribus/fonts/sfnt.cpp
    trunk/Scribus/scribus/pageitempointer.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusapp.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/ui/scrspinbox.cpp

Modified: trunk/Scribus/scribus/fonts/sfnt.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24887&path=/trunk/Scribus/scribus/fonts/sfnt.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/sfnt.cpp	(original)
+++ trunk/Scribus/scribus/fonts/sfnt.cpp	Thu Feb  3 20:45:13 2022
@@ -725,7 +725,7 @@
 				symbolFormat = format;
 				continue;
 			}
-			format = 1; // no such format
+//			format = 1; // no such format
 		}
 		// If no unicode cmap was found, fallback on ms symbol cmap
 		uint format = unicodeFormat;

Modified: trunk/Scribus/scribus/pageitempointer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24887&path=/trunk/Scribus/scribus/pageitempointer.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitempointer.cpp	(original)
+++ trunk/Scribus/scribus/pageitempointer.cpp	Thu Feb  3 20:45:13 2022
@@ -17,7 +17,7 @@
 void PageItemPointerDB::addToDB(const QString & key, PageItem * value)
 {
 	insert(key,value);
-	connect ( value,SIGNAL( destroyed ( QObject* ) ),this,SLOT( removeFromDB ( QObject* ) ) );
+	connect(value, SIGNAL(destroyed(QObject*)), this, SLOT(removeFromDB(QObject*)));
 }
 
 void PageItemPointerDB::removeFromDB ( QObject * obj )

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24887&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Thu Feb  3 20:45:13 2022
@@ -788,8 +788,8 @@
 	connect(docCheckerPalette, SIGNAL(selectElement(PageItem*,bool,int)), this, SLOT(selectItemFromOutlines(PageItem*,bool,int)));
 	connect(docCheckerPalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
-	connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem*,bool)));
-	connect(outlinePalette, SIGNAL(editElementByItem(PageItem *)), this, SLOT(editItemsFromOutlines(PageItem *)));
+	connect(outlinePalette, SIGNAL(selectElementByItem(PageItem*,bool)), this, SLOT(selectItemsFromOutlines(PageItem*,bool)));
+	connect(outlinePalette, SIGNAL(editElementByItem(PageItem*)), this, SLOT(editItemsFromOutlines(PageItem*)));
 	connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
 	connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
 	connect(nodePalette, SIGNAL(paletteClosed()), this, SLOT(slotSelect()));
@@ -798,7 +798,7 @@
 
 	connect(bookmarkPalette->BView, SIGNAL(markMoved()), this, SLOT(StoreBookmarks()));
 	connect(bookmarkPalette->BView, SIGNAL(changed()), this, SLOT(slotDocCh()));
-	connect(bookmarkPalette->BView, SIGNAL(selectElement(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
+	connect(bookmarkPalette->BView, SIGNAL(selectElement(PageItem*,bool)), this, SLOT(selectItemsFromOutlines(PageItem*,bool)));
 	// guides
 	connect(scrActions["pageManageGuides"], SIGNAL(toggled(bool)), guidePalette, SLOT(setPaletteShown(bool)));
 	connect(guidePalette, SIGNAL(paletteShown(bool)), scrActions["pageManageGuides"], SLOT(setChecked(bool)));
@@ -831,8 +831,8 @@
 	scrapbookPalette->setOpenScrapbooks(m_prefsManager.appPrefs.scrapbookPrefs.RecentScrapbooks);
 	rebuildRecentPasteMenu();
 	connect(scrapbookPalette, SIGNAL(updateRecentMenue()), this, SLOT(rebuildRecentPasteMenu()));
-	connect(ScCore->fileWatcher, SIGNAL(dirChanged(QString )), scrapbookPalette, SLOT(reloadLib(QString )));
-	connect(ScCore->fileWatcher, SIGNAL(dirDeleted(QString )), scrapbookPalette, SLOT(closeOnDel(QString )));
+	connect(ScCore->fileWatcher, SIGNAL(dirChanged(QString)), scrapbookPalette, SLOT(reloadLib(QString)));
+	connect(ScCore->fileWatcher, SIGNAL(dirDeleted(QString)), scrapbookPalette, SLOT(closeOnDel(QString)));
 }
 
 bool ScribusMainWindow::warningVersion(QWidget *parent)
@@ -1440,7 +1440,7 @@
 
 	statusBar()->addPermanentWidget(unitSwitcher,0);
 	statusBar()->addPermanentWidget(mainWindowProgressBar, 0);
-	connect(statusBar(), SIGNAL(messageChanged(const QString &)), this, SLOT(setTempStatusBarText(const QString &)));
+	connect(statusBar(), SIGNAL(messageChanged(QString)), this, SLOT(setTempStatusBarText(QString)));
 
 }
 
@@ -1819,7 +1819,7 @@
 		int windowCount = windows.count();
 		for ( int i = 0; i < windowCount; ++i )
 		{
-			tw = qobject_cast<ScribusWin *>(windows.at(i));
+//			tw = qobject_cast<ScribusWin *>(windows.at(i));
 			QMdiSubWindow *tws = windows.at(i);
 			ScribusWin* scw = dynamic_cast<ScribusWin *>(tws->widget());
 			if (scw)
@@ -2625,7 +2625,7 @@
 	connect(view, SIGNAL(HaveSel()), this, SLOT(HaveNewSel()), Qt::UniqueConnection);
 	connect(view, SIGNAL(DocChanged()), this, SLOT(slotDocCh()), Qt::UniqueConnection);
 	connect(view, SIGNAL(MousePos(double,double)), this, SLOT(setStatusBarMousePosition(double,double)), Qt::UniqueConnection);
-	connect(view, SIGNAL(ItemCharStyle(const CharStyle&)), contentPalette, SLOT(update(const CharStyle&)), Qt::UniqueConnection);
+	connect(view, SIGNAL(ItemCharStyle(CharStyle)), contentPalette, SLOT(update(CharStyle)), Qt::UniqueConnection);
 	connect(view, SIGNAL(ItemTextEffects(int)), this, SLOT(setStyleEffects(int)), Qt::UniqueConnection);
 	connect(view, SIGNAL(ItemTextAlign(int)), this, SLOT(setAlignmentValue(int)), Qt::UniqueConnection);
 	connect(view, SIGNAL(LoadElem(QString,double,double,bool,bool,ScribusDoc*,ScribusView*)), this, SLOT(slotElemRead(QString,double,double,bool,bool,ScribusDoc*,ScribusView*)), Qt::UniqueConnection);
@@ -7004,7 +7004,7 @@
 	}
 	else
 	{
-		QDir di = QDir();
+//		QDir di = QDir();
 		if (!doc->m_Selection->isEmpty())
 			filename = QDir::currentPath() + "/" + doc->documentFileName() + "_selection.eps";
 		else
@@ -7175,7 +7175,7 @@
 			std::vector<int> pageNs2;
 			pageNs2.clear();
 			pageNs2.push_back(pageNs[aa]);
-			pageNumbersSize = pageNs2.size();
+//			pageNumbersSize = pageNs2.size();
 			QImage thumb(10, 10, QImage::Format_ARGB32_Premultiplied);
 			if (doc->pdfOptions().Thumbnails)
 				thumb = allThumbs[pageNs[aa]];

Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24887&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp	(original)
+++ trunk/Scribus/scribus/scribusapp.cpp	Thu Feb  3 20:45:13 2022
@@ -455,15 +455,15 @@
 #endif
 
 	langs.append(QLocale::system().name());
-
-	// remove duplicate entries...
-	QStringList::Iterator it = langs.end();
-	while (it != langs.begin())
-	{
-		--it;
-		if (langs.count(*it) > 1)
-			it = langs.erase(it);
-	}
+	langs.removeDuplicates();
+//	// remove duplicate entries...
+//	QStringList::Iterator it = langs.end();
+//	while (it != langs.begin())
+//	{
+//		--it;
+//		if (langs.count(*it) > 1)
+//			it = langs.erase(it);
+//	}
 	return langs;
 }
 

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24887&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Thu Feb  3 20:45:13 2022
@@ -6013,11 +6013,12 @@
 	int counter = pageSets()[m_docPrefsData.docSetupPrefs.pagePositioning].FirstPage;
 	int rowcounter = 0;
 	double maxYPos=0.0, maxXPos=0.0;
-	double currentXPos=m_docPrefsData.displayPrefs.scratch.left(), currentYPos=m_docPrefsData.displayPrefs.scratch.top(), lastYPos=Pages->at(0)->initialHeight();
+	double currentXPos=m_docPrefsData.displayPrefs.scratch.left();
+	double currentYPos=m_docPrefsData.displayPrefs.scratch.top();
+	double lastYPos=Pages->at(0)->initialHeight();
 //	currentXPos += (pageWidth+pageSets[currentPageLayout].GapHorizontal) * counter;
 	currentXPos += (m_docPrefsData.docSetupPrefs.pageWidth+m_docPrefsData.displayPrefs.pageGapHorizontal) * counter;
 
-	lastYPos = Pages->at(0)->initialHeight();
 	ScPage* page;
 	int docPageCount=Pages->count();
 	for (int i = 0; i < docPageCount; ++i)

Modified: trunk/Scribus/scribus/ui/scrspinbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24887&path=/trunk/Scribus/scribus/ui/scrspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.cpp	(original)
+++ trunk/Scribus/scribus/ui/scrspinbox.cpp	Thu Feb  3 20:45:13 2022
@@ -45,8 +45,9 @@
 	setLocale(LocaleManager::instance().userPreferredLocale());
 	setSingleStep(1.0);
 	lineEdit()->setValidator(nullptr);
-	disconnect(this, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged()));
-	connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged()));
+// just for testing
+//	disconnect(this, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged()));
+//	connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged()));
 	installEventFilter(this);
 }
 




More information about the scribus-commit mailing list