Pith - wedge_linux
wedge_linux/main.cpp [0.8 kb]
Modified: 00:30:32 77 026 (04 Jun 026)
20 Days Ago
#include <QApplication>
#include <QSharedMemory>
#include <QSystemSemaphore>
#include "NoteWindow.h"

int main(int argc, char *argv[]) {
    QApplication a(argc, argv);

    QSystemSemaphore semaphore("wedge_03569", 1);
    semaphore.acquire();

#ifndef Q_OS_WIN
    QSharedMemory nix_fix("wedge_key_03569");
    if (nix_fix.attach()) {
        nix_fix.detach();
    }
#endif

    static QSharedMemory sharedMemory("wedge_key_03569");
    bool isRunning = false;
    if (!sharedMemory.create(1)) {
        isRunning = true;
    }
    
    semaphore.release();

    if (isRunning) {
        return 0; 
    }

    QCoreApplication::setOrganizationName("wedge");
    QCoreApplication::setApplicationName("wedge");
    QApplication::setApplicationDisplayName("wedge");

    a.setQuitOnLastWindowClosed(false);

    NoteWindow w;
    w.show();
    return a.exec();
}
Updates
OTC Applet - Linux 93.026.1
Wedge - Linux 90.026.1
Wedge - Android 90.026.1
Shim - Android 86.026.1
Kerf - Android 86.026.4
Dev
TVShow (227) 'CSA'
TVShow (228) 'APT'
TVProgram (83) 'BXT'
Miter Update(s)
Peen (Messaging)

Menu
Calendar
Project Tin (024/029)
Miter
RSS Feed
User Avatar
@vgmlr
=SUM(parts)