Skip to content

Commit d7f2bc7

Browse files
author
Alexander Bychuk
committed
Merge remote-tracking branch 'origin/cmake'
fix : replace build system with cmake
2 parents 5a870a4 + afdc1df commit d7f2bc7

File tree

14 files changed

+430
-598
lines changed

14 files changed

+430
-598
lines changed

.gdbinit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
python
2+
import sys, os.path
3+
sys.path.insert(0, os.path.expanduser('~/.gdb'))
4+
import qt5printers
5+
qt5printers.register_printers(gdb.current_objfile())
6+
end

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ qrc_*.cpp
88
*.qmake.stash
99
/cmake-build-Debug/
1010
/cmake-build-Release/
11+
/.idea/
12+
/cmake-build-debug/

CMakeLists.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
project(Qldd LANGUAGES CXX)
4+
5+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
6+
7+
set(CMAKE_AUTOUIC ON)
8+
set(CMAKE_AUTOMOC ON)
9+
set(CMAKE_AUTORCC ON)
10+
11+
set(CMAKE_CXX_STANDARD 11)
12+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
13+
14+
find_package(Qt5 COMPONENTS Widgets REQUIRED)
15+
16+
if (APPLE)
17+
set(MACOSX_BUNDLE_BUNDLE_NAME Qldd)
18+
set(BUNDLE_VAL MACOSX_BUNDLE)
19+
add_executable(Qldd MACOSX_BUNDLE)
20+
else()
21+
add_executable(Qldd)
22+
endif()
23+
24+
set(SOURCES
25+
main.cpp
26+
mainwindow.cpp
27+
mainwindow.h
28+
mainwindow.ui
29+
qldd.cpp
30+
qldd.h
31+
)
32+
target_sources(Qldd PRIVATE ${SOURCES})
33+
target_link_libraries(Qldd PRIVATE Qt5::Widgets)

Qldd.app/Contents/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

Qldd.app/Contents/MacOS/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

Qldd.app/Contents/Resources/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

Qldd.pro

Lines changed: 0 additions & 25 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
LinuxDependency
1+
DependencyViewer
22
===============
33

4-
LinuxDependency (Qldd) shows all dependent libraries of a given executable or dynamic library on Linux.
5-
It is a GUI replacement for the ldd, file and nm commands.
4+
DependencyViewer (Qldd) shows all dependent libraries of a given executable or dynamic library on GNU/Linux and MacOS.
5+
It is a GUI replacement for the ldd (for MacOS - otool), file and nm commands.
66

77
![Dependencies](screenshot/Qldd.png?raw=true "Qldd")
88
![Dependencies](screenshot/Qldd-Export.png?raw=true "Qldd")

main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
int main(int argc, char *argv[]) {
77
QApplication app(argc, argv);
88

9-
app.setApplicationName("Qldd");
10-
app.setApplicationVersion("1.0");
9+
QApplication::setApplicationName("Qldd");
10+
QApplication::setApplicationVersion("1.0");
1111

1212
QCommandLineParser parser;
1313
parser.setApplicationDescription("Qldd gui over ldd utility");
@@ -20,7 +20,7 @@ int main(int argc, char *argv[]) {
2020
const QStringList args = parser.positionalArguments();
2121

2222
QString fName;
23-
if (args.size() > 0) {
23+
if (!args.empty()) {
2424
fName = args.at(0);
2525
}
2626

mainwindow.cpp

Lines changed: 41 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,32 @@
77
#include <QShortcut>
88
#include <QMessageBox>
99

10+
#ifdef __APPLE__
11+
#define FIXED_FONT "Menlo"
12+
#else
13+
#define FIXED_FONT "Monospace"
14+
#endif
15+
1016
MainWindow::MainWindow(const QString &fileName, QWidget *parent)
1117
: QMainWindow(parent),
1218
ui(new Ui::MainWindow),
13-
qldd(NULL),
14-
shortcutClose(NULL),
15-
fileMenu(NULL),
16-
helpMenu(NULL),
17-
openAct(NULL),
18-
aboutAct(NULL),
19-
aboutQtAct(NULL),
20-
exitAct(NULL) {
19+
qldd(nullptr),
20+
shortcutClose(nullptr),
21+
fileMenu(nullptr),
22+
helpMenu(nullptr),
23+
openAct(nullptr),
24+
aboutAct(nullptr),
25+
aboutQtAct(nullptr),
26+
exitAct(nullptr) {
2127
ui->setupUi(this);
2228

29+
QFont fixedFont(FIXED_FONT);
30+
fixedFont.setPixelSize(ui->lineEditFileName->font().pixelSize());
31+
fixedFont.setStyleHint(QFont::Monospace);
32+
33+
ui->listWidgetExportTable->setFont(fixedFont);
34+
ui->treeWidget->setFont(fixedFont);
35+
2336
shortcutClose = new QShortcut(QKeySequence(Qt::Key_Escape), this);
2437
connect(shortcutClose, SIGNAL(activated()), this, SLOT(close()));
2538

@@ -33,90 +46,27 @@ MainWindow::MainWindow(const QString &fileName, QWidget *parent)
3346

3447
MainWindow::~MainWindow() {
3548
delete ui;
36-
if (qldd) {
37-
delete qldd;
38-
}
3949
delete fileMenu;
4050
delete helpMenu;
41-
delete openAct;
42-
delete aboutAct;
43-
delete aboutQtAct;
44-
delete exitAct;
4551
}
4652

4753
void MainWindow::reset(const QString &fileName) {
48-
if (qldd) {
49-
delete qldd;
50-
qldd = NULL;
51-
}
52-
qldd = new QLdd(fileName, qApp->applicationDirPath());
54+
qldd.reset(new QLdd(fileName, qApp->applicationDirPath()));
5355
QTreeWidgetItem *header = ui->treeWidget->headerItem();
5456
header->setText(0, "Dependency");
5557
qldd->fillDependency(*ui->treeWidget);
5658
qldd->fillExportTable(*ui->listWidgetExportTable);
57-
#ifdef __APPLE__
58-
QFont sansFont("Helvetica [Cronyx]", 12);
59-
QFont monoFont("Menlo", 12);
60-
ui->treeWidget->setFont(sansFont);
61-
ui->listWidgetExportTable->setFont(monoFont);
62-
#endif
6359

64-
ui->labelName->setText("File Name ");
65-
#ifdef __APPLE__
66-
ui->labelName->setFont(sansFont);
67-
#endif
6860
ui->lineEditFileName->setText(qldd->getBinaryName());
69-
#ifdef __APPLE__
70-
ui->lineEditFileName->setFont(sansFont);
71-
#endif
72-
ui->labelSize->setText("File Size ");
73-
#ifdef __APPLE__
74-
ui->labelSize->setFont(sansFont);
75-
#endif
7661
ui->lineEditFileSize->setText(qldd->getStringFileSize() + "( " + QString::number(qldd->getFileSize()) + " bytes )");
77-
#ifdef __APPLE__
78-
ui->lineEditFileSize->setFont(sansFont);
79-
#endif
80-
ui->labelTimeAccess->setText("Access Time ");
81-
#ifdef __APPLE__
82-
ui->labelTimeAccess->setFont(sansFont);
83-
#endif
8462
ui->lineEditTimeAccess->setText(qldd->getAccessTime());
85-
#ifdef __APPLE__
86-
ui->lineEditTimeAccess->setFont(sansFont);
87-
#endif
88-
ui->labelTimeStatus->setText("Status Time ");
89-
#ifdef __APPLE__
90-
ui->labelTimeStatus->setFont(sansFont);
91-
#endif
9263
ui->lineEditTimeStatus->setText(qldd->getStatusTime());
93-
#ifdef __APPLE__
94-
ui->lineEditTimeStatus->setFont(sansFont);
95-
#endif
96-
ui->labelTimeModify->setText("Modify Time ");
97-
#ifdef __APPLE__
98-
ui->labelTimeModify->setFont(sansFont);
99-
#endif
10064
ui->lineEditTimeModify->setText(qldd->getModifyTime());
101-
#ifdef __APPLE__
102-
ui->lineEditTimeModify->setFont(sansFont);
103-
#endif
10465

10566
ui->lineEditOwner->setText(qldd->getOwnerName());
106-
#ifdef __APPLE__
107-
ui->labelOwner->setFont(sansFont);
108-
ui->lineEditOwner->setFont(sansFont);
109-
#endif
11067
ui->lineEditGroup->setText(qldd->getGroupName());
111-
#ifdef __APPLE__
112-
ui->labelGroup->setFont(sansFont);
113-
ui->lineEditGroup->setFont(sansFont);
114-
#endif
11568

11669
ui->textEditInformation->setText(qldd->getInfo());
117-
#ifdef __APPLE__
118-
ui->textEditInformation->setFont(sansFont);
119-
#endif
12070

12171
QMOD owner = qldd->getOwnerMod();
12272
QMOD group = qldd->getGroupMod();
@@ -145,11 +95,7 @@ void MainWindow::open() {
14595
void MainWindow::about() {
14696
QMessageBox::about(this,
14797
tr("About Application"),
148-
#ifdef __APPLE__
149-
tr("UnixDependency shows all dependent libraries of a "
150-
#else
151-
tr("LinuxDependency shows all dependent libraries of a "
152-
#endif
98+
tr("DependencyViewer shows all dependent libraries of a "
15399
"given executable or dynamic library on Linux. It is a GUI replacement for the ldd, file and nm command."));
154100
}
155101

@@ -183,3 +129,21 @@ void MainWindow::createMenus() {
183129
helpMenu->addAction(aboutAct);
184130
helpMenu->addAction(aboutQtAct);
185131
}
132+
133+
void MainWindow::on_checkBoxOwnerRead_clicked(bool checked) { ui->checkBoxOwnerRead->setChecked(!checked); }
134+
135+
void MainWindow::on_checkBoxOwnerWrite_clicked(bool checked) { ui->checkBoxOwnerWrite->setChecked(!checked); }
136+
137+
void MainWindow::on_checkBoxOwnerExec_clicked(bool checked) { ui->checkBoxOwnerExec->setChecked(!checked); }
138+
139+
void MainWindow::on_checkBoxGroupRead_clicked(bool checked) { ui->checkBoxGroupRead->setChecked(!checked); }
140+
141+
void MainWindow::on_checkBoxGroupWrite_clicked(bool checked) { ui->checkBoxGroupWrite->setChecked(!checked); }
142+
143+
void MainWindow::on_checkBoxGroupExec_clicked(bool checked) { ui->checkBoxGroupExec->setChecked(!checked); }
144+
145+
void MainWindow::on_checkBoxOtherRead_clicked(bool checked) { ui->checkBoxOtherRead->setChecked(!checked); }
146+
147+
void MainWindow::on_checkBoxOtherWrite_clicked(bool checked) { ui->checkBoxOtherWrite->setChecked(!checked); }
148+
149+
void MainWindow::on_checkBoxOtherExec_clicked(bool checked) { ui->checkBoxOtherExec->setChecked(!checked); }

0 commit comments

Comments
 (0)