Skip to content

Commit

Permalink
Fix compilation error on Ubuntu (#31)
Browse files Browse the repository at this point in the history
In addition:
- Fix passing arguments to newClient
- Remove unused macro for DBUS_SERVICE_NAME
  • Loading branch information
falbru authored May 16, 2024
1 parent f9ae4a9 commit 485ca61
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/kakounecli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int KakouneCli::run(QStringList command)
}
else
{
QString request = QString("{\"method\":\"newClient\",\"args\":\"%1\"}").arg(command[1]);
QString request = QString("{\"method\":\"newClient\",\"args\":\"%1\"}").arg(command.mid(1).join(" "));
m_socket->write(request.toLocal8Bit());
m_socket->flush();
}
Expand Down
2 changes: 1 addition & 1 deletion src/kakouneclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ KakouneClient::KakouneClient(const QString &session_id, QString arguments,
});

connect(&m_process, &QProcess::readyReadStandardError,
[=]() { qFatal() << "KakouneClient: " << m_process.readAllStandardError(); });
[=]() { qCritical() << "KakouneClient: " << m_process.readAllStandardError(); });

connect(&m_process, &QProcess::finished, this, &KakouneClient::finished);

Expand Down
8 changes: 4 additions & 4 deletions src/kakounesession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void createFifo(const QString &path)
{
if (mkfifo(path.toStdString().c_str(), 0666) == -1)
{
qFatal("Failed to create fifo");
qCritical("Failed to create fifo");
}
}

Expand All @@ -27,7 +27,7 @@ void waitForFifo(const QString &path)
int fd = open(path.toStdString().c_str(), O_RDONLY);
if (fd == -1)
{
qFatal("Failed to read from fifo");
qCritical("Failed to read from fifo");
}

char buffer[16];
Expand All @@ -42,7 +42,7 @@ void deleteFifo(const QString &path)
{
if (unlink(path.toStdString().c_str()) == -1)
{
qFatal("Failed to remove fifo");
qCritical("Failed to remove fifo");
}
}

Expand All @@ -51,7 +51,7 @@ KakouneSession::KakouneSession(QString session_id)
m_session_id = session_id;

connect(&m_process, &QProcess::readyReadStandardError,
[=]() { qFatal() << "KakouneSession: " << m_process.readAllStandardError(); });
[=]() { qCritical() << "KakouneSession: " << m_process.readAllStandardError(); });

QString session_ready_path = "/tmp/" + session_id;

Expand Down
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include "mainwindow.hpp"
#include <QApplication>

#define DBUS_SERVICE_NAME "com.github.falbru.KakouneQt"

QString generateRandomKakouneSessionId()
{
return QString::number(QRandomGenerator::global()->bounded(1000, 9999));
Expand Down

0 comments on commit 485ca61

Please sign in to comment.