aboutsummaryrefslogtreecommitdiff
path: root/lib/UnrarXLib/rdwrfn.cpp
diff options
context:
space:
mode:
authorJonathan Marshall <jmarshall@xbmc.org>2014-06-09 21:13:00 +1200
committerJonathan Marshall <jmarshall@xbmc.org>2014-07-14 14:21:22 +1200
commit2fcd1b4b6d77eb8eb4e56fc61b0bc1b3e230db4d (patch)
tree4cbeb332d8cf042c3504cc8f1a8703d81c02db3a /lib/UnrarXLib/rdwrfn.cpp
parent7b8fcdbfa67b842fa427c79a0f75e940ddbdfb75 (diff)
[rar] add a callback class for unrarlib rather than calling into guilib direct from UnrarXLib
Diffstat (limited to 'lib/UnrarXLib/rdwrfn.cpp')
-rw-r--r--lib/UnrarXLib/rdwrfn.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/UnrarXLib/rdwrfn.cpp b/lib/UnrarXLib/rdwrfn.cpp
index 4eae8fa696..0ca2208f94 100644
--- a/lib/UnrarXLib/rdwrfn.cpp
+++ b/lib/UnrarXLib/rdwrfn.cpp
@@ -1,6 +1,5 @@
#include "rar.hpp"
#include "URL.h"
-#include "dialogs/GUIDialogProgress.h"
ComprDataIO::ComprDataIO()
{
@@ -35,7 +34,8 @@ void ComprDataIO::Init()
CurrentCommand=0;
ProcessedArcSize=TotalArcSize=0;
bQuit = false;
- m_pDlgProgress = NULL;
+ m_progress = NULL;
+ m_context = NULL;
}
int ComprDataIO::UnpRead(byte *Addr,uint Count)
@@ -143,12 +143,8 @@ int ComprDataIO::UnpRead(byte *Addr,uint Count)
return(-1);
}
CurUnpStart = CurUnpRead;
- if (m_pDlgProgress)
- {
- CURL url(SrcArc->FileName);
- m_pDlgProgress->SetLine(0,url.GetWithoutUserDetails()); // update currently extracted rar file
- m_pDlgProgress->Progress();
- }
+ if (m_progress)
+ m_progress(m_context, -1, SrcArc->FileName);
}
else
break;
@@ -241,12 +237,9 @@ void ComprDataIO::UnpWrite(byte *Addr,uint Count)
}
ShowUnpWrite();
Wait();
- if (m_pDlgProgress)
+ if (m_progress)
{
- m_pDlgProgress->ShowProgressBar(true);
- m_pDlgProgress->SetPercentage(int(float(CurUnpWrite)/float(((Archive*)SrcFile)->NewLhd.FullUnpSize)*100));
- m_pDlgProgress->Progress();
- if (m_pDlgProgress->IsCanceled())
+ if (!m_progress(m_context, int(float(CurUnpWrite)/float(((Archive*)SrcFile)->NewLhd.FullUnpSize)*100), NULL))
bQuit = true;
}
}