From cab6169e6c03c26316e3a494d87cde468fee66fd Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Mon, 7 Dec 2020 14:36:46 +0100 Subject: dev-vcs/qgit: EAPI-7 bump, drop {eutils,qt4-r2}.eclass for cmake,xdg Revert 3f25d12a, b68c3e76 to build with Qt4 at all. Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner --- dev-vcs/qgit/Manifest | 1 + dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-1.patch | 164 ++++++++++++++++++++++ dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-2.patch | 141 +++++++++++++++++++ dev-vcs/qgit/qgit-2.9.ebuild | 40 ++++-- profiles/updates/4Q-2020 | 1 + 5 files changed, 332 insertions(+), 15 deletions(-) create mode 100644 dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-1.patch create mode 100644 dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-2.patch diff --git a/dev-vcs/qgit/Manifest b/dev-vcs/qgit/Manifest index 236635a6..681ab9e0 100644 --- a/dev-vcs/qgit/Manifest +++ b/dev-vcs/qgit/Manifest @@ -1 +1,2 @@ DIST qgit-2.9.tar.gz 263875 BLAKE2B 8ec1235c760f2473a0700e7033ab99f3e72f019dee47761b86999a7de173132cf6592e9f5652b68285cd126adc4efffb5688944f34be2686683727354ab041c5 SHA512 2c91e02d0a7ea1e4620882520c77b47ff9b28fb9c9f9d178bf98b3e728e600e8d86a9e6e4cd60c33dbe63ced3636934fb7cdd6b0d5fa58182873675e3f97cc33 +DIST qgit-tab_remove.png 471 BLAKE2B 6a45992d729d77dcdff25ff50a0c366c76832fd82bec3705b8d94fb78cb07056ed59e98d27d82939948634f073d3591c48abd09759b82b5dc2c88e08be6ef3f4 SHA512 f4afe6e94c883c00a28dd9a25b21b8920d46499fca081547ea42ba15737647f9b291e7d2a36f802823ad3fa6db074b70245c7f87b95a7663b6b8a2cb96370b46 diff --git a/dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-1.patch b/dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-1.patch new file mode 100644 index 00000000..23e0d265 --- /dev/null +++ b/dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-1.patch @@ -0,0 +1,164 @@ +From f1c1c28e31146d272375a75f4f4684ae30b8f17b Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner +Date: Mon, 7 Dec 2020 14:23:41 +0100 +Subject: [PATCH] Revert "MainImpl: Move tab close button onto tabs" + +This reverts commit 3f25d12ae9a023d3bff12f9b24f1b3fcf9ef0368. +--- + qgit.vcproj | 4 ++++ + src/icons.qrc | 1 + + src/mainimpl.cpp | 29 +++++++++++++++-------------- + src/mainimpl.h | 4 ++-- + src/mainview.ui | 3 --- + 5 files changed, 22 insertions(+), 19 deletions(-) + +diff --git a/qgit.vcproj b/qgit.vcproj +index de3bd65..e8a2985 100644 +--- a/qgit.vcproj ++++ b/qgit.vcproj +@@ -236,6 +236,10 @@ + RelativePath=".\src\resources\source_py.png" + > + ++ ++ + +diff --git a/src/icons.qrc b/src/icons.qrc +index 09eb321..95f31f9 100644 +--- a/src/icons.qrc ++++ b/src/icons.qrc +@@ -38,6 +38,7 @@ + resources/source_java.png + resources/source_pl.png + resources/source_py.png ++ resources/tab_remove.png + resources/tar.png + resources/txt.png + resources/vcs_commit.png +diff --git a/src/mainimpl.cpp b/src/mainimpl.cpp +index 3831df9..5109055 100644 +--- a/src/mainimpl.cpp ++++ b/src/mainimpl.cpp +@@ -115,11 +115,14 @@ MainImpl::MainImpl(SCRef cd, QWidget* p) : QMainWindow(p) { + rv = new RevsView(this, git, true); // set has main domain + tabWdg->addTab(rv->tabPage(), "&Rev list"); + +- // hide close button for rev list tab +- QTabBar* const tabBar = tabWdg->tabBar(); +- tabBar->setTabButton(0, QTabBar::RightSide, NULL); +- tabBar->setTabButton(0, QTabBar::LeftSide, NULL); +- connect(tabWdg, SIGNAL(tabCloseRequested(int)), SLOT(tabBar_tabCloseRequested(int))); ++ // set-up tab corner widget ('close tab' button) ++ QToolButton* ct = new QToolButton(tabWdg); ++ ct->setIcon(QIcon(QString::fromUtf8(":/icons/resources/tab_remove.png"))); ++ ct->setToolTip("Close tab"); ++ ct->setEnabled(false); ++ tabWdg->setCornerWidget(ct); ++ connect(ct, SIGNAL(clicked()), this, SLOT(pushButtonCloseTab_clicked())); ++ connect(this, SIGNAL(closeTabButtonEnabled(bool)), ct, SLOT(setEnabled(bool))); + + // set-up file names loading progress bar + pbFileNamesLoading = new QProgressBar(statusBar()); +@@ -614,10 +617,10 @@ void MainImpl::treeView_doubleClicked(QTreeWidgetItem* item, int) { + } + } + +-void MainImpl::tabBar_tabCloseRequested(int index) { ++void MainImpl::pushButtonCloseTab_clicked() { + + Domain* t; +- switch (tabType(&t, index)) { ++ switch (currentTabType(&t)) { + case TAB_REV: + break; + case TAB_PATCH: +@@ -629,7 +632,7 @@ void MainImpl::tabBar_tabCloseRequested(int index) { + ActViewFileNewTab->setEnabled(ActViewFile->isEnabled() && firstTab()); + break; + default: +- dbs("ASSERT in tabBar_tabCloseRequested: unknown current page"); ++ dbs("ASSERT in pushButtonCloseTab_clicked: unknown current page"); + break; + } + } +@@ -1023,13 +1026,8 @@ bool MainImpl::event(QEvent* e) { + + int MainImpl::currentTabType(Domain** t) { + +- return tabType(t, tabWdg->currentIndex()); +-} +- +-int MainImpl::tabType(Domain** t, int index) { +- + *t = NULL; +- QWidget* curPage = tabWdg->widget(index); ++ QWidget* curPage = tabWdg->currentWidget(); + if (curPage == rv->tabPage()) { + *t = rv; + return TAB_REV; +@@ -1100,12 +1098,15 @@ void MainImpl::tabWdg_currentChanged(int w) { + switch (currentTabType(&t)) { + case TAB_REV: + static_cast(t)->tab()->listViewLog->setFocus(); ++ emit closeTabButtonEnabled(false); + break; + case TAB_PATCH: + static_cast(t)->tab()->textEditDiff->setFocus(); ++ emit closeTabButtonEnabled(true); + break; + case TAB_FILE: + static_cast(t)->tab()->histListView->setFocus(); ++ emit closeTabButtonEnabled(true); + break; + default: + dbs("ASSERT in tabWdg_currentChanged: unknown current page"); +diff --git a/src/mainimpl.h b/src/mainimpl.h +index 3089a95..b5916b6 100644 +--- a/src/mainimpl.h ++++ b/src/mainimpl.h +@@ -60,6 +60,7 @@ signals: + void closeAllWindows(); + void closeAllTabs(); + void changeFont(const QFont&); ++ void closeTabButtonEnabled(bool); + void typeWriterFontChanged(); + void flagChanged(uint); + +@@ -92,7 +93,7 @@ protected slots: + void changesCommitted(bool); + void lineEditSHA_returnPressed(); + void lineEditFilter_returnPressed(); +- void tabBar_tabCloseRequested(int index); ++ void pushButtonCloseTab_clicked(); + void ActBack_activated(); + void ActForward_activated(); + void ActFind_activated(); +@@ -144,7 +145,6 @@ private: + void updateRevVariables(SCRef sha); + void setupShortcuts(); + int currentTabType(Domain** t); +- int tabType(Domain** t, int index); + void filterList(bool isOn, bool onlyHighlight); + bool isMatch(SCRef sha, SCRef f, int cn, const QMap& sm); + void highlightAbbrevSha(SCRef abbrevSha); +diff --git a/src/mainview.ui b/src/mainview.ui +index 43736a1..4d320b2 100644 +--- a/src/mainview.ui ++++ b/src/mainview.ui +@@ -62,9 +62,6 @@ + + + +- +- true +- + + + Tab&Wdg +-- +2.29.2 + diff --git a/dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-2.patch b/dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-2.patch new file mode 100644 index 00000000..e095aaf7 --- /dev/null +++ b/dev-vcs/qgit/files/qgit-2.9-fix-qt4-build-2.patch @@ -0,0 +1,141 @@ +From 23d202d3c6cd4451bd8e50848474156b38c1c65e Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner +Date: Mon, 7 Dec 2020 14:32:49 +0100 +Subject: [PATCH] Revert "improve display of branches/tags in contextmenu" + +This reverts commit b68c3e769fce2cf29e0cb1965e2d260783fb964b. +--- + src/mainimpl.cpp | 98 ++++++++++++++++++++++++++++++------------------ + 1 file changed, 62 insertions(+), 36 deletions(-) + +diff --git a/src/mainimpl.cpp b/src/mainimpl.cpp +index 5109055..39e6af5 100644 +--- a/src/mainimpl.cpp ++++ b/src/mainimpl.cpp +@@ -1322,31 +1322,23 @@ void MainImpl::doUpdateRecentRepoMenu(SCRef newEntry) { + settings.setValue(REC_REP_KEY, newRecents); + } + +-static void prepareRefSubmenu(QMenu* menu, const QStringList& refs, const QChar sep = '/') { +- +- FOREACH_SL (it, refs) { +- const QStringList& parts(it->split(sep, QString::SkipEmptyParts)); +- QMenu* add_here = menu; +- FOREACH_SL (pit, parts) { +- if (pit == parts.end() - 1) break; +- QMenu* found = add_here->findChild(*pit, Qt::FindDirectChildrenOnly); +- if(!found) { +- found = add_here->addMenu(*pit); +- found->setObjectName(*pit); +- } +- add_here = found; +- } +- QAction* act = add_here->addAction(*it); +- act->setData("Ref"); ++static int cntMenuEntries(const QMenu& menu) { ++ ++ int cnt = 0; ++ QList al(menu.actions()); ++ FOREACH (QList, it, al) { ++ if (!(*it)->isSeparator()) ++ cnt++; + } ++ return cnt; + } + + void MainImpl::doContexPopup(SCRef sha) { + + QMenu contextMenu(this); +- QMenu contextBrnMenu("Branches...", this); ++ QMenu contextBrnMenu("More branches...", this); ++ QMenu contextTagMenu("More tags...", this); + QMenu contextRmtMenu("Remote branches...", this); +- QMenu contextTagMenu("Tags...", this); + + connect(&contextMenu, SIGNAL(triggered(QAction*)), this, SLOT(goRef_triggered(QAction*))); + +@@ -1391,29 +1383,63 @@ void MainImpl::doContexPopup(SCRef sha) { + if (ActPop->isEnabled()) + contextMenu.addAction(ActPop); + +- contextMenu.addSeparator(); ++ const QStringList& bn(git->getAllRefNames(Git::BRANCH, Git::optOnlyLoaded)); ++ const QStringList& rbn(git->getAllRefNames(Git::RMT_BRANCH, Git::optOnlyLoaded)); ++ const QStringList& tn(git->getAllRefNames(Git::TAG, Git::optOnlyLoaded)); ++ QAction* act = NULL; + +- QStringList bn(git->getAllRefNames(Git::BRANCH, Git::optOnlyLoaded)); +- bn.sort(); +- prepareRefSubmenu(&contextBrnMenu, bn); +- contextMenu.addMenu(&contextBrnMenu); +- contextBrnMenu.setEnabled(bn.size() > 0); ++ FOREACH_SL (it, rbn) { ++ act = contextRmtMenu.addAction(*it); ++ act->setData("Ref"); ++ } + +- QStringList rbn(git->getAllRefNames(Git::RMT_BRANCH, Git::optOnlyLoaded)); +- rbn.sort(); +- prepareRefSubmenu(&contextRmtMenu, rbn); +- contextMenu.addMenu(&contextRmtMenu); +- contextRmtMenu.setEnabled(rbn.size() > 0); ++ // halve the possible remaining entries for branches and tags ++ int remainingEntries = (MAX_MENU_ENTRIES - cntMenuEntries(contextMenu)); ++ if (!contextRmtMenu.isEmpty()) --remainingEntries; ++ int tagEntries = remainingEntries / 2; ++ int brnEntries = remainingEntries - tagEntries; + +- QStringList tn(git->getAllRefNames(Git::TAG, Git::optOnlyLoaded)); +- tn.sort(); +- prepareRefSubmenu(&contextTagMenu, tn); +- contextMenu.addSeparator(); +- contextMenu.addMenu(&contextTagMenu); +- contextTagMenu.setEnabled(tn.size() > 0); ++ // display more branches, if there are few tags ++ if (tagEntries > tn.count()) ++ tagEntries = tn.count(); + +- } ++ // one branch less because of the "More branches..." submenu ++ if ((bn.count() > brnEntries) && tagEntries) ++ tagEntries++; ++ ++ if (!bn.empty()) ++ contextMenu.addSeparator(); ++ ++ FOREACH_SL (it, bn) { ++ if ( cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES - tagEntries ++ || (*it == bn.last() && contextBrnMenu.isEmpty())) ++ act = contextMenu.addAction(*it); ++ else ++ act = contextBrnMenu.addAction(*it); + ++ act->setData("Ref"); ++ } ++ if (!contextBrnMenu.isEmpty()) ++ contextMenu.addMenu(&contextBrnMenu); ++ ++ if (!contextRmtMenu.isEmpty()) ++ contextMenu.addMenu(&contextRmtMenu); ++ ++ if (!tn.empty()) ++ contextMenu.addSeparator(); ++ ++ FOREACH_SL (it, tn) { ++ if ( cntMenuEntries(contextMenu) < MAX_MENU_ENTRIES ++ || (*it == tn.last() && contextTagMenu.isEmpty())) ++ act = contextMenu.addAction(*it); ++ else ++ act = contextTagMenu.addAction(*it); ++ ++ act->setData("Ref"); ++ } ++ if (!contextTagMenu.isEmpty()) ++ contextMenu.addMenu(&contextTagMenu); ++ } + QPoint p = QCursor::pos(); + p += QPoint(10, 10); + contextMenu.exec(p); +-- +2.29.2 + diff --git a/dev-vcs/qgit/qgit-2.9.ebuild b/dev-vcs/qgit/qgit-2.9.ebuild index 344adcaa..ecd14921 100644 --- a/dev-vcs/qgit/qgit-2.9.ebuild +++ b/dev-vcs/qgit/qgit-2.9.ebuild @@ -1,30 +1,40 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -# $Id$ -EAPI=4 +EAPI=7 -inherit eutils qt4-r2 +inherit cmake xdg -DESCRIPTION="Qt4 GUI for git repositories" +DESCRIPTION="Qt GUI for git repositories" HOMEPAGE="https://github.com/tibirna/qgit" -SRC_URI="https://github.com/tibirna/${PN}/archive/${P}.tar.gz" +SRC_URI="https://github.com/tibirna/qgit/archive/${P}.tar.gz +https://raw.githubusercontent.com/tibirna/${PN}/fb47a8006bb9342e46dadb2883ba8eda86642ee1/src/resources/tab_remove.png -> ${PN}-tab_remove.png" LICENSE="GPL-2" -SLOT="2" -KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos" +SLOT="0" +KEYWORDS="amd64 ~arm ~ppc ~ppc64 x86" IUSE="" -DEPEND="dev-qt/qtgui:4" +DEPEND=" + dev-qt/qtcore:4 + dev-qt/qtgui:4 +" RDEPEND="${DEPEND} - >=dev-vcs/git-1.6 + dev-vcs/git " -S="${WORKDIR}"/${PN}-${P} +S="${WORKDIR}/${PN}-${P}" + +DOCS=( README.adoc ) + +PATCHES=( "${FILESDIR}"/${P}-fix-qt4-build-{1,2}.patch ) + +src_prepare() { + cmake_src_prepare + mv "${DISTDIR}"/${PN}-tab_remove.png src/resources/tab_remove.png || die +} -src_install() { - newbin bin/qgit qgit4 - newicon src/resources/qgit.png qgit4.png - make_desktop_entry qgit4 QGit qgit4 - dodoc README +src_configure() { + local mycmakeargs=( -DUseQt5=OFF ) + cmake_src_configure } diff --git a/profiles/updates/4Q-2020 b/profiles/updates/4Q-2020 index 2358f6fa..304ba220 100644 --- a/profiles/updates/4Q-2020 +++ b/profiles/updates/4Q-2020 @@ -1 +1,2 @@ move sys-auth/polkit-kde-agent kde-plasma/polkit-kde-agent +slotmove =dev-vcs/qgit-2.9 2 0 -- cgit v1.2.3-65-gdbad