Commit ed92a34b authored by Philipp Erhardt's avatar Philipp Erhardt
Browse files

Adjust coding style

parent 79f7f38e
......@@ -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
......
......@@ -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);
}
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment