Remove unneeded get()
This commit is contained in:
parent
6d8b0b3ab6
commit
215057ce6f
|
@ -160,7 +160,7 @@ void Player::Init() {
|
|||
|
||||
QSettings s;
|
||||
|
||||
if (!engine_.get()) {
|
||||
if (!engine_) {
|
||||
s.beginGroup(BackendSettingsPage::kSettingsGroup);
|
||||
Engine::EngineType enginetype = Engine::EngineTypeFromName(s.value("engine", EngineName(Engine::GStreamer)).toString().toLower());
|
||||
s.endGroup();
|
||||
|
|
|
@ -213,7 +213,7 @@ void MtpDevice::StartDelete() { StartCopy(nullptr); }
|
|||
|
||||
bool MtpDevice::DeleteFromStorage(const DeleteJob &job) {
|
||||
|
||||
if (!connection_.get() || !connection_->is_valid()) return false;
|
||||
if (!connection_ || !connection_->is_valid()) return false;
|
||||
|
||||
// Extract the ID from the song's URL
|
||||
QString filename = job.metadata_.url().path();
|
||||
|
|
|
@ -78,7 +78,7 @@ QList<DeviceFinder::Device> MacOsDeviceFinder::ListDevices() {
|
|||
|
||||
UInt32 device_size_bytes = 0;
|
||||
std::unique_ptr<AudioDeviceID> devices = GetProperty<AudioDeviceID>(kAudioObjectSystemObject, address, &device_size_bytes);
|
||||
if (!devices.get()) {
|
||||
if (!devices) {
|
||||
return ret;
|
||||
}
|
||||
const UInt32 device_count = device_size_bytes / sizeof(AudioDeviceID);
|
||||
|
@ -91,7 +91,7 @@ QList<DeviceFinder::Device> MacOsDeviceFinder::ListDevices() {
|
|||
address.mSelector = kAudioDevicePropertyDeviceNameCFString;
|
||||
std::unique_ptr<CFStringRef> device_name = GetProperty<CFStringRef>(id, address);
|
||||
ScopedCFTypeRef<CFStringRef> scoped_device_name(*device_name.get());
|
||||
if (!device_name.get()) {
|
||||
if (!device_name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -484,7 +484,7 @@ void QobuzService::TryLogin() {
|
|||
|
||||
void QobuzService::ResetArtistsRequest() {
|
||||
|
||||
if (artists_request_.get()) {
|
||||
if (artists_request_) {
|
||||
QObject::disconnect(artists_request_.get(), nullptr, this, nullptr);
|
||||
QObject::disconnect(this, nullptr, artists_request_.get(), nullptr);
|
||||
artists_request_.reset();
|
||||
|
@ -539,7 +539,7 @@ void QobuzService::ArtistsUpdateProgressReceived(const int id, const int progres
|
|||
|
||||
void QobuzService::ResetAlbumsRequest() {
|
||||
|
||||
if (albums_request_.get()) {
|
||||
if (albums_request_) {
|
||||
QObject::disconnect(albums_request_.get(), nullptr, this, nullptr);
|
||||
QObject::disconnect(this, nullptr, albums_request_.get(), nullptr);
|
||||
albums_request_.reset();
|
||||
|
@ -592,7 +592,7 @@ void QobuzService::AlbumsUpdateProgressReceived(const int id, const int progress
|
|||
|
||||
void QobuzService::ResetSongsRequest() {
|
||||
|
||||
if (songs_request_.get()) {
|
||||
if (songs_request_) {
|
||||
QObject::disconnect(songs_request_.get(), nullptr, this, nullptr);
|
||||
QObject::disconnect(this, nullptr, songs_request_.get(), nullptr);
|
||||
songs_request_.reset();
|
||||
|
|
|
@ -393,7 +393,7 @@ void SubsonicService::Scrobble(const QString &song_id, const bool submission, co
|
|||
return;
|
||||
}
|
||||
|
||||
if (!scrobble_request_.get()) {
|
||||
if (!scrobble_request_) {
|
||||
// we're doing requests every 30-240s the whole time, so keep reusing this instance
|
||||
scrobble_request_.reset(new SubsonicScrobbleRequest(this, url_handler_, app_, this));
|
||||
}
|
||||
|
@ -404,7 +404,7 @@ void SubsonicService::Scrobble(const QString &song_id, const bool submission, co
|
|||
|
||||
void SubsonicService::ResetSongsRequest() {
|
||||
|
||||
if (songs_request_.get()) {
|
||||
if (songs_request_) {
|
||||
QObject::disconnect(songs_request_.get(), nullptr, this, nullptr);
|
||||
QObject::disconnect(this, nullptr, songs_request_.get(), nullptr);
|
||||
songs_request_.reset();
|
||||
|
|
|
@ -720,7 +720,7 @@ void TidalService::TryLogin() {
|
|||
|
||||
void TidalService::ResetArtistsRequest() {
|
||||
|
||||
if (artists_request_.get()) {
|
||||
if (artists_request_) {
|
||||
QObject::disconnect(artists_request_.get(), nullptr, this, nullptr);
|
||||
QObject::disconnect(this, nullptr, artists_request_.get(), nullptr);
|
||||
artists_request_.reset();
|
||||
|
@ -779,7 +779,7 @@ void TidalService::ArtistsUpdateProgressReceived(const int id, const int progres
|
|||
|
||||
void TidalService::ResetAlbumsRequest() {
|
||||
|
||||
if (albums_request_.get()) {
|
||||
if (albums_request_) {
|
||||
QObject::disconnect(albums_request_.get(), nullptr, this, nullptr);
|
||||
QObject::disconnect(this, nullptr, albums_request_.get(), nullptr);
|
||||
albums_request_.reset();
|
||||
|
@ -836,7 +836,7 @@ void TidalService::AlbumsUpdateProgressReceived(const int id, const int progress
|
|||
|
||||
void TidalService::ResetSongsRequest() {
|
||||
|
||||
if (songs_request_.get()) {
|
||||
if (songs_request_) {
|
||||
QObject::disconnect(songs_request_.get(), nullptr, this, nullptr);
|
||||
QObject::disconnect(this, nullptr, songs_request_.get(), nullptr);
|
||||
songs_request_.reset();
|
||||
|
|
|
@ -415,7 +415,7 @@ TEST_F(SingleSong, TestUrls) {
|
|||
EXPECT_TRUE(new_song.is_valid());
|
||||
EXPECT_EQ(new_song.url(), url);
|
||||
|
||||
QSqlDatabase db(database_.get()->Connect());
|
||||
QSqlDatabase db(database_->Connect());
|
||||
QSqlQuery q(db);
|
||||
q.prepare(QString("SELECT url FROM %1 WHERE url = :url").arg(SCollection::kSongsTable));
|
||||
|
||||
|
|
Loading…
Reference in New Issue