Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philipp Erhardt
katarakt
Commits
ed92a34b
Commit
ed92a34b
authored
Aug 14, 2015
by
Philipp Erhardt
Browse files
Adjust coding style
parent
79f7f38e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/dbus/dbus.cpp
View file @
ed92a34b
...
...
@@ -9,8 +9,7 @@
using
namespace
std
;
void
dbus_init
(
Viewer
*
viewer
)
{
void
dbus_init
(
Viewer
*
viewer
)
{
/* Add dbus interfaces to the viewer object.
*
* These are automatically destroyed, if the parent object is.
...
...
@@ -19,8 +18,7 @@ void dbus_init(Viewer *viewer)
*/
new
SourceCorrelate
(
viewer
);
QString
bus_name
=
QString
(
"katarakt.pid%1"
)
.
arg
(
QApplication
::
applicationPid
());
QString
bus_name
=
QString
(
"katarakt.pid%1"
).
arg
(
QApplication
::
applicationPid
());
if
(
!
QDBusConnection
::
sessionBus
().
registerService
(
bus_name
))
{
#ifdef DEBUG
...
...
src/dbus/source_correlate.cpp
View file @
ed92a34b
...
...
@@ -10,18 +10,17 @@
using
namespace
std
;
SourceCorrelate
::
SourceCorrelate
(
Viewer
*
viewer
)
:
QDBusAbstractAdaptor
(
viewer
),
viewer
(
viewer
)
{
SourceCorrelate
::
SourceCorrelate
(
Viewer
*
viewer
)
:
QDBusAbstractAdaptor
(
viewer
),
viewer
(
viewer
)
{
connect
(
viewer
->
get_canvas
(),
SIGNAL
(
synchronize_editor
(
int
,
int
,
int
)),
this
,
SLOT
(
emit_edit_signal
(
int
,
int
,
int
)));
}
}
void
SourceCorrelate
::
view
(
QString
filename
,
int
page
,
double
x
,
double
y
)
{
if
(
page
<
0
)
void
SourceCorrelate
::
view
(
QString
filename
,
int
page
,
double
x
,
double
y
)
{
if
(
page
<
0
)
{
return
;
}
QFileInfo
oldFile
=
QFileInfo
(
viewer
->
get_res
()
->
get_file
());
QFileInfo
newFile
=
QFileInfo
(
filename
);
QUrl
url
(
filename
);
...
...
@@ -40,9 +39,10 @@ void SourceCorrelate::view(QString filename, int page, double x, double y)
viewer
->
get_res
()
->
store_jump
(
current_page
);
}
void
SourceCorrelate
::
emit_edit_signal
(
int
page
,
int
x
,
int
y
)
{
void
SourceCorrelate
::
emit_edit_signal
(
int
page
,
int
x
,
int
y
)
{
QString
file
=
viewer
->
get_res
()
->
get_file
();
#ifdef DEBUG
qDebug
(
"Emitting the edit signal"
);
#endif
emit
edit
(
file
,
page
,
x
,
y
);
}
src/resourcemanager.cpp
View file @
ed92a34b
...
...
@@ -65,7 +65,7 @@ void ResourceManager::initialize(const QString &file, const QByteArray &password
connect
(
i_notifier
,
SIGNAL
(
activated
(
int
)),
this
,
SLOT
(
inotify_slot
()),
Qt
::
UniqueConnection
);
inotify_wd
=
inotify_add_watch
(
inotify_fd
,
info
.
path
().
toUtf8
().
constData
(),
IN_CLOSE_WRITE
|
IN_MOVED_TO
);
inotify_wd
=
inotify_add_watch
(
inotify_fd
,
info
.
path
().
toUtf8
().
constData
(),
IN_CLOSE_WRITE
|
IN_MOVED_TO
);
if
(
inotify_wd
==
-
1
)
{
cerr
<<
"inotify_add_watch: "
<<
strerror
(
errno
)
<<
endl
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment