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