Skip to content

Qt console application that receives and validates a license file based on the MAC address provided.

License

Unknown and 2 other licenses found

Licenses found

Unknown
license.cpp
Unknown
license.h
Unknown
license-check-console.pro
Notifications You must be signed in to change notification settings

tinvaan/license-check-console

Repository files navigation

#include "license.h"

#include <string>
#include <iostream>

#include <QFile>
#include <QDebug>
#include <QTextStream>
#include <QCryptographicHash>

void License::printLicenseHash() const
{
    qDebug() << m_licenseHash;
}

uint License::generateLicenseHash(QString addr)
{
    return qHash(addr);
}

void License::saveToFile(QString fileName, QString path)
{
    QFile file(fileName);
    QDir::setCurrent(path);

    if ( !file.open(QIODevice::WriteOnly | QIODevice::Text) ) {
        qDebug() << "Failed to open file.";
        return;
    }

    QTextStream stream(&file);
    stream << m_licenseHash;
}

QDate License::getExpiryDate() const
{
    return m_expiryDate;
}

uint License::getLicenseHash() const
{
    return m_licenseHash;
}

QString License::getMacAddress() const
{
    return m_macAddress;
}

void License::setExpiryDate(QDate expiry)
{
    m_expiryDate = expiry;
}

void License::setMacAddress(QString mac)
{
    m_macAddress = mac;
}

About

Qt console application that receives and validates a license file based on the MAC address provided.

Topics

License

Unknown and 2 other licenses found

Licenses found

Unknown
license.cpp
Unknown
license.h
Unknown
license-check-console.pro

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published