Skip to content

Commit

Permalink
removing no longer needed downloadItemsStarted signal
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Jan 10, 2025
1 parent 95afeb6 commit e009be9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
12 changes: 6 additions & 6 deletions app/test/testmerginapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2965,12 +2965,12 @@ void TestMerginApi::testDownloadWithNetworkError()
mApi->setNetworkManager( failingManager );

// Create signal spies
QSignalSpy startSpy( mApi, &MerginApi::downloadItemsStarted );
QSignalSpy startSpy( mApi, &MerginApi::pullFilesStarted );
QSignalSpy retrySpy( mApi, &MerginApi::downloadItemRetried );
QSignalSpy finishSpy( mApi, &MerginApi::syncProjectFinished );

// Trigger the current network error when download starts
connect( mApi, &MerginApi::downloadItemsStarted, this, [this, failingManager, networkError]()
connect( mApi, &MerginApi::pullFilesStarted, this, [this, failingManager, networkError]()
{
failingManager->setShouldFail( true, networkError );
} );
Expand Down Expand Up @@ -3002,7 +3002,7 @@ void TestMerginApi::testDownloadWithNetworkError()
QVERIFY( !localProject.isValid() );

// Disconnect all signals
disconnect( mApi, &MerginApi::downloadItemsStarted, this, nullptr );
disconnect( mApi, &MerginApi::pullFilesStarted, this, nullptr );

// Clean up
mApi->setNetworkManager( originalManager );
Expand All @@ -3023,7 +3023,7 @@ void TestMerginApi::testDownloadWithNetworkErrorRecovery()
mApi->setNetworkManager( failingManager );

// Create signal spies
QSignalSpy startSpy( mApi, &MerginApi::downloadItemsStarted );
QSignalSpy startSpy( mApi, &MerginApi::pullFilesStarted );
QSignalSpy retrySpy( mApi, &MerginApi::downloadItemRetried );
QSignalSpy finishSpy( mApi, &MerginApi::syncProjectFinished );

Expand All @@ -3038,13 +3038,13 @@ void TestMerginApi::testDownloadWithNetworkErrorRecovery()
if ( retryCount == 2 )
{
failingManager->setShouldFail( false );
disconnect( mApi, &MerginApi::downloadItemsStarted, nullptr, nullptr );
disconnect( mApi, &MerginApi::pullFilesStarted, nullptr, nullptr );
disconnect( mApi, &MerginApi::downloadItemRetried, nullptr, nullptr );
}
} );

// Trigger network error when download starts
connect( mApi, &MerginApi::downloadItemsStarted, this, [failingManager, networkError]()
connect( mApi, &MerginApi::pullFilesStarted, this, [failingManager, networkError]()
{
failingManager->setShouldFail( true, networkError );
} );
Expand Down
2 changes: 0 additions & 2 deletions core/merginapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2445,8 +2445,6 @@ void MerginApi::startProjectPull( const QString &projectFullName )
}
else
{
emit downloadItemsStarted();

while ( transaction.replyPullItems.count() < 5 && !transaction.downloadQueue.isEmpty() )
{
downloadNextItem( projectFullName );
Expand Down
1 change: 0 additions & 1 deletion core/merginapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ class MerginApi: public QObject
void networkManagerChanged();

void downloadItemRetried( const QString &projectFullName, int retryCount );
void downloadItemsStarted();

private slots:
void listProjectsReplyFinished( QString requestId );
Expand Down

0 comments on commit e009be9

Please sign in to comment.