View Issue Details

IDProjectCategoryView StatusLast Update
0017137ScribusGeneralpublic2024-02-12 21:10
Reporterale Assigned Toale  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.7.0.svn 
Fixed in Version1.7.0.svn 
Summary0017137: HelpBrowser: fix deprecation warnings
Description- apply the deprecation warnings about the order of the shortcuts in QAction
- use new world signals and slots for the trivial cases
- remove some commented out code
TagsNo tags attached.
PatchNo

Activities

ale

2024-01-21 10:57

manager  

helbrowser.diff (5,353 bytes)   
diff --git a/scribus/ui/helpbrowser.cpp b/scribus/ui/helpbrowser.cpp
index 1d244c173..f129155cc 100644
--- a/scribus/ui/helpbrowser.cpp
+++ b/scribus/ui/helpbrowser.cpp
@@ -258,32 +258,26 @@ void HelpBrowser::setupLocalUI()
 	histMenu = new QMenu(this);
 
 	//Add Menu items
-	filePrint = fileMenu->addAction(iconManager.loadIcon("16/document-print.png"), "", this, SLOT(print()), Qt::CTRL|Qt::Key_P);
+	filePrint = fileMenu->addAction(iconManager.loadIcon("16/document-print.png"), "", Qt::CTRL|Qt::Key_P, this, &HelpBrowser::print);
 	fileMenu->addSeparator();
-	fileExit = fileMenu->addAction(iconManager.loadIcon("exit.png"), "", this, SLOT(close()), Qt::CTRL|Qt::Key_W);
-	editFind = editMenu->addAction(iconManager.loadIcon("find.png"), "", this, SLOT(find()), Qt::CTRL|Qt::Key_F);
-	editFindNext = editMenu->addAction( "", this, SLOT(findNext()), Qt::Key_F3);
-	editFindPrev = editMenu->addAction( "", this, SLOT(findPrevious()), Qt::SHIFT|Qt::Key_F3);
-	bookAdd = bookMenu->addAction( "", this, SLOT(bookmarkButton_clicked()), Qt::CTRL|Qt::Key_D);
-//New style code for future
-//	editFindNext = editMenu->addAction( "", Qt::Key_F3, this, SLOT(findNext()));
-//	editFindPrev = editMenu->addAction( "", Qt::SHIFT|Qt::Key_F3, this, SLOT(findPrevious()));
-//	bookAdd = bookMenu->addAction( "", Qt::CTRL|Qt::Key_D), this, SLOT(bookmarkButton_clicked());
-	bookDel = bookMenu->addAction( "", this, SLOT(deleteBookmarkButton_clicked()));
-	bookDelAll = bookMenu->addAction( "", this, SLOT(deleteAllBookmarkButton_clicked()));
+	fileExit = fileMenu->addAction(iconManager.loadIcon("exit.png"), "", Qt::CTRL|Qt::Key_W, this, &HelpBrowser::close);
+	editFind = editMenu->addAction(iconManager.loadIcon("find.png"), "", Qt::CTRL|Qt::Key_F, this, &HelpBrowser::find);
+	editFindNext = editMenu->addAction( "", Qt::Key_F3, this, &HelpBrowser::findNext);
+	editFindPrev = editMenu->addAction( "", Qt::SHIFT|Qt::Key_F3, this, &HelpBrowser::findPrevious);
+	bookAdd = bookMenu->addAction( "", Qt::CTRL|Qt::Key_D, this, &HelpBrowser::bookmarkButton_clicked);
+	bookDel = bookMenu->addAction( "", this, &HelpBrowser::deleteBookmarkButton_clicked);
+	bookDelAll = bookMenu->addAction( "", this, &HelpBrowser::deleteAllBookmarkButton_clicked);
 
 	//Add Toolbar items
-	goHome = toolBar->addAction(iconManager.loadIcon("16/go-home.png"), "", textBrowser, SLOT(home()));
-	goBack = toolBar->addAction(iconManager.loadIcon("16/go-previous.png"), "", textBrowser, SLOT(backward()));
-	goFwd = toolBar->addAction(iconManager.loadIcon("16/go-next.png"), "", textBrowser, SLOT(forward()));
+	goHome = toolBar->addAction(iconManager.loadIcon("16/go-home.png"), "", textBrowser, &ScTextBrowser::home);
+	goBack = toolBar->addAction(iconManager.loadIcon("16/go-previous.png"), "", textBrowser, &ScTextBrowser::backward);
+	goFwd = toolBar->addAction(iconManager.loadIcon("16/go-next.png"), "", textBrowser, &ScTextBrowser::forward);
 	goBack->setMenu(histMenu);
 	
 	helpNav->listView->header()->hide();
 	helpNav->searchingView->header()->hide();
 	helpNav->bookmarksView->header()->hide();
 
-//	splitter->setStretchFactor(splitter->indexOf(tabWidget), 0);
-//	splitter->setStretchFactor(splitter->indexOf(textBrowser), 1);
 	// reset previous size
 	m_prefs = PrefsManager::instance().prefsFile->getPluginContext("helpbrowser");
 	int xsize = m_prefs->getUInt("xsize", 640);
@@ -293,28 +287,18 @@ void HelpBrowser::setupLocalUI()
 	//basic ui
 	connect(histMenu, SIGNAL(triggered(QAction*)), this, SLOT(histChosen(QAction*)));
 	// searching
-	connect(helpNav->searchingEdit, SIGNAL(returnPressed()), this, SLOT(searchingButton_clicked()));
-	connect(helpNav->searchingButton, SIGNAL(clicked()), this, SLOT(searchingButton_clicked()));
+	connect(helpNav->searchingEdit, &QLineEdit::returnPressed, this, &HelpBrowser::searchingButton_clicked);
+	connect(helpNav->searchingButton, &QPushButton::clicked, this, &HelpBrowser::searchingButton_clicked);
 	connect(helpNav->searchingView, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemSearchSelected(QTreeWidgetItem*,int)));
 	// bookmarks
-	connect(helpNav->bookmarkButton, SIGNAL(clicked()), this, SLOT(bookmarkButton_clicked()));
-	connect(helpNav->deleteBookmarkButton, SIGNAL(clicked()), this, SLOT(deleteBookmarkButton_clicked()));
-	connect(helpNav->deleteAllBookmarkButton, SIGNAL(clicked()), this, SLOT(deleteAllBookmarkButton_clicked()));
+	connect(helpNav->bookmarkButton, &QPushButton::clicked, this, &HelpBrowser::bookmarkButton_clicked);
+	connect(helpNav->deleteBookmarkButton, &QPushButton::clicked, this, &HelpBrowser::deleteBookmarkButton_clicked);
+	connect(helpNav->deleteAllBookmarkButton, &QPushButton::clicked, this, &HelpBrowser::deleteAllBookmarkButton_clicked);
 	connect(helpNav->bookmarksView, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(itemBookmarkSelected(QTreeWidgetItem*,int)));
-	// links hoover
-//	connect(textBrowser, SIGNAL(overLink(QString)), this, SLOT(showLinkContents(QString)));
-
-	// status bar
-//	connect(textBrowser,SIGNAL(statusBarMessage(QString)), this->statusBar(), SLOT(showMessage(QString)));
 	
 	languageChange();
 }
 
-//void HelpBrowser::showLinkContents(const QString &link)
-//{
-//	statusBar()->showMessage(link);
-//}
-
 void HelpBrowser::addHistoryItem(const histd2& histItem)
 {
 	m_history[histMenu->addAction(histItem.title)] = histItem;
helbrowser.diff (5,353 bytes)   

jghali

2024-01-31 21:29

administrator   ~0050957

Applied, thanks!

Issue History

Date Modified Username Field Change
2024-01-21 10:57 ale New Issue
2024-01-21 10:57 ale File Added: helbrowser.diff
2024-01-31 21:20 jghali Summary helpmanager: apply deprecation warnings => HelpBrowser: fix deprecation warnings
2024-01-31 21:29 jghali Assigned To => ale
2024-01-31 21:29 jghali Status new => resolved
2024-01-31 21:29 jghali Resolution open => fixed
2024-01-31 21:29 jghali Fixed in Version => 1.7.0.svn
2024-01-31 21:29 jghali Note Added: 0050957
2024-02-12 21:10 cbradney Status resolved => closed