Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nheko-reborn/nheko
1 result
Show changes
Commits on Source (11)
id: io.github.NhekoReborn.Nheko
command: nheko
runtime: org.kde.Platform
#runtime-version: '5.15-21.08'
# use old runtime, newer one crashes on arm!
runtime-version: '5.15'
sdk: org.kde.Sdk
rename-icon: nheko
......@@ -90,6 +92,8 @@ modules:
- -Dvapi=false
- -Dgtk_doc=false
- -Dintrospection=false
# https://gitlab.gnome.org/GNOME/libsecret/-/issues/49
- -Dgcrypt=false
sources:
- commit: 3fe635e64efd4b8dbc9ec3548b0bc8034c7665c4
tag: 0.20.4
......
......@@ -96,7 +96,7 @@
<message>
<location line="+12"/>
<source>Unknown microphone: %1</source>
<translation type="unfinished"></translation>
<translation>Microfono sconosciuto: %1</translation>
</message>
<message>
<location line="+8"/>
......
......@@ -48,7 +48,7 @@ Item {
anchors.top: replyContainer.top
anchors.bottom: replyContainer.bottom
width: 4
color: TimelineManager.userColor(userId, Nheko.colors.window)
color: TimelineManager.userColor(userId, Nheko.colors.base)
}
Column {
......
......@@ -28,22 +28,19 @@ Q_DECLARE_METATYPE(std::vector<std::string>)
Q_DECLARE_METATYPE(std::vector<QString>)
Q_DECLARE_METATYPE(std::set<QString>)
namespace {
auto client_ = std::make_shared<mtx::http::Client>();
}
namespace http {
mtx::http::Client *
client()
{
static auto client_ = std::make_shared<mtx::http::Client>();
return client_.get();
}
bool
is_logged_in()
{
return !client_->access_token().empty();
return !client()->access_token().empty();
}
void
......
......@@ -7,6 +7,7 @@
#include <QApplication>
#include <QBuffer>
#include <QComboBox>
#include <QCryptographicHash>
#include <QDesktopWidget>
#include <QGuiApplication>
#include <QImageReader>
......@@ -641,13 +642,9 @@ utils::linkColor()
uint32_t
utils::hashQString(const QString &input)
{
uint32_t hash = 0;
auto h = QCryptographicHash::hash(input.toUtf8(), QCryptographicHash::Sha1);
for (int i = 0; i < input.length(); i++) {
hash = input.at(i).digitValue() + ((hash << 5) - hash);
}
return hash;
return (h[0] << 24) ^ (h[1] << 16) ^ (h[2] << 8) ^ h[3];
}
QColor
......@@ -658,7 +655,10 @@ utils::generateContrastingHexColor(const QString &input, const QColor &backgroun
// Create a color for the input
auto hash = hashQString(input);
// create a hue value based on the hash of the input.
auto userHue = static_cast<int>(hash % 360);
// Adapted to make Nico blue
auto userHue =
static_cast<int>(static_cast<double>(hash - static_cast<uint32_t>(0x60'00'00'00)) /
std::numeric_limits<uint32_t>::max() * 360.);
// start with moderate saturation and lightness values.
auto sat = 230;
auto lightness = 125;
......
......@@ -243,7 +243,8 @@ main(int argc, char *argv[])
app.setFont(font);
QString lang = QLocale::system().name();
if (QLocale().language() == QLocale::C)
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedKingdom));
QTranslator qtTranslator;
qtTranslator.load(QLocale(), "qt", "_", QLibraryInfo::location(QLibraryInfo::TranslationsPath));
......
......@@ -494,12 +494,14 @@ void SingleApplicationPrivate::slotDataAvailable( QLocalSocket *dataSocket, quin
if ( !isFrameComplete( dataSocket ) )
return;
Q_EMIT q->receivedMessage( instanceId, dataSocket->readAll() );
auto message = dataSocket->readAll();
writeAck( dataSocket );
ConnectionInfo &info = connectionMap[dataSocket];
info.stage = StageConnectedHeader;
Q_EMIT q->receivedMessage(instanceId, message);
}
void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId )
......