ffmpeg: add build script and CMake integration
This commit is contained in:
1 parent
d497a8dc92
commit
2d53b3120f
13 files changed
+446
-40
No files matched your search
@@ -31,8 +31,9 @@ MemberPropsDialog::MemberPropsDialog(DbManager* db, const QString& channelId,
|
||||
bool haveKey = (m_edPrivkey.size() == 32);
|
||||
bool isOwn = (m_nodeId == m_db->myNodeId());
|
||||
|
||||
bool isAdmin = false, isSuper = false;
|
||||
bool isAdmin = false, isSuper = false, isStorage = false;
|
||||
QString curNick;
|
||||
m_currentVer = 0;
|
||||
if (m_db->m_db) {
|
||||
QString tbl = m_db->peersTableName(channelId);
|
||||
QByteArray sql = QString(
|
||||
@@ -44,8 +45,11 @@ MemberPropsDialog::MemberPropsDialog(DbManager* db, const QString& channelId,
|
||||
if (sqlite3_step(st) == SQLITE_ROW) {
|
||||
const char* tags = (const char*)sqlite3_column_text(st, 0);
|
||||
if (tags) {
|
||||
const char* vp = strstr(tags, "ver=");
|
||||
if (vp) m_currentVer = atoi(vp + 4);
|
||||
if (strstr(tags, "admin=yes")) isAdmin = true;
|
||||
if (strstr(tags, "supernode=yes")) isSuper = true;
|
||||
if (strstr(tags, "storage=yes")) isStorage = true;
|
||||
}
|
||||
curNick = DbManager::colText(st, 1);
|
||||
}
|
||||
@@ -88,6 +92,11 @@ MemberPropsDialog::MemberPropsDialog(DbManager* db, const QString& channelId,
|
||||
m_superCb->setEnabled(haveKey);
|
||||
layout->addWidget(m_superCb);
|
||||
|
||||
m_storageCb = new QCheckBox("Storage (priority attachment keeper)", this);
|
||||
m_storageCb->setChecked(isStorage);
|
||||
m_storageCb->setEnabled(haveKey);
|
||||
layout->addWidget(m_storageCb);
|
||||
|
||||
if (!haveKey) {
|
||||
auto* hint = new QLabel("(Admin/Super require channel private key)", this);
|
||||
hint->setStyleSheet("color: gray; font-size: 11px;");
|
||||
@@ -144,12 +153,11 @@ void MemberPropsDialog::onSave() {
|
||||
/* signed fields — only if key available */
|
||||
if (m_edPrivkey.size() != 32) { accept(); return; }
|
||||
|
||||
QString tags;
|
||||
if (m_adminCb->isChecked()) tags += "admin=yes";
|
||||
if (m_superCb->isChecked()) {
|
||||
if (!tags.isEmpty()) tags += ",";
|
||||
tags += "supernode=yes";
|
||||
}
|
||||
int ver = m_currentVer + 1;
|
||||
QString tags = QString("ver=%1").arg(ver);
|
||||
if (m_adminCb->isChecked()) tags += ",admin=yes";
|
||||
if (m_superCb->isChecked()) tags += ",supernode=yes";
|
||||
if (m_storageCb->isChecked()) tags += ",storage=yes";
|
||||
|
||||
QByteArray msg = tags.toUtf8();
|
||||
uint64_t le = htole64(m_nodeId);
|
||||
@@ -170,7 +178,7 @@ void MemberPropsDialog::onSave() {
|
||||
}
|
||||
|
||||
QByteArray sql = QString(
|
||||
"UPDATE \"%1\" SET adm_tags=?, adm_tags_sig=?, node_type=? WHERE node_id=?"
|
||||
"UPDATE \"%1\" SET adm_tags=?, adm_tags_sig=?, node_type=?, storage=? WHERE node_id=?"
|
||||
).arg(tbl).toUtf8();
|
||||
sqlite3_stmt* st = nullptr;
|
||||
if (sqlite3_prepare_v2(m_db->m_db, sql.constData(), -1, &st, nullptr) == SQLITE_OK) {
|
||||
@@ -179,7 +187,9 @@ void MemberPropsDialog::onSave() {
|
||||
sqlite3_bind_blob(st, 2, sig, 64, SQLITE_TRANSIENT);
|
||||
int nt = m_superCb->isChecked() ? 4 : 1;
|
||||
sqlite3_bind_int(st, 3, nt);
|
||||
sqlite3_bind_int64(st, 4, (sqlite3_int64)m_nodeId);
|
||||
int stg = m_storageCb->isChecked() ? 1 : 0;
|
||||
sqlite3_bind_int(st, 4, stg);
|
||||
sqlite3_bind_int64(st, 5, (sqlite3_int64)m_nodeId);
|
||||
sqlite3_step(st);
|
||||
sqlite3_finalize(st);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user