Commit da5378a6 authored by Craig Watson's avatar Craig Watson

Code clean-up

Mostly, removal of old code that had been commented out instead of
removed
parent 631b070e
...@@ -27,10 +27,7 @@ ...@@ -27,10 +27,7 @@
#include "UBBoardController.h" #include "UBBoardController.h"
//#include <QtGui>
#include <QtWidgets> #include <QtWidgets>
//#include <QtWebKit>
#include <QtWebKitWidgets> #include <QtWebKitWidgets>
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
...@@ -992,8 +989,6 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c ...@@ -992,8 +989,6 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
if (isBackground) if (isBackground)
oldBackgroundObject = mActiveScene->backgroundObject(); oldBackgroundObject = mActiveScene->backgroundObject();
//if(sUrl.startsWith("uniboardTool://"))
//if(sUrl.startsWith("openboardTool://",Qt::CaseInsensitive))
if(sUrl.startsWith("openboardtool://")) if(sUrl.startsWith("openboardtool://"))
{ {
...@@ -1094,7 +1089,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl ...@@ -1094,7 +1089,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
mActiveScene->deselectAllItems(); mActiveScene->deselectAllItems();
//if (!sourceUrl.toString().startsWith("file://") && !sourceUrl.toString().startsWith("uniboardTool://"))
if (!sourceUrl.toString().startsWith("file://") && !sourceUrl.toString().startsWith("openboardtool://")) if (!sourceUrl.toString().startsWith("file://") && !sourceUrl.toString().startsWith("openboardtool://"))
showMessage(tr("Download finished")); showMessage(tr("Download finished"));
...@@ -1375,7 +1369,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl ...@@ -1375,7 +1369,6 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime()));
} }
} }
//else if (UBMimeType::UniboardTool == itemMimeType)
else if (UBMimeType::OpenboardTool == itemMimeType) else if (UBMimeType::OpenboardTool == itemMimeType)
{ {
qDebug() << "accepting mime type" << mimeType << "OpenBoard Tool"; qDebug() << "accepting mime type" << mimeType << "OpenBoard Tool";
......
...@@ -347,7 +347,6 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) : ...@@ -347,7 +347,6 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
featuresModel = new UBFeaturesModel(featuresList, this); featuresModel = new UBFeaturesModel(featuresList, this);
//featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction); //featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
//featuresModel->setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);
featuresProxyModel = new UBFeaturesProxyModel(this); featuresProxyModel = new UBFeaturesProxyModel(this);
featuresProxyModel->setFilterFixedString(rootPath); featuresProxyModel->setFilterFixedString(rootPath);
...@@ -607,7 +606,6 @@ void UBFeaturesController::addToFavorite( const QUrl &path ) ...@@ -607,7 +606,6 @@ void UBFeaturesController::addToFavorite( const QUrl &path )
void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManualy) void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManualy)
{ {
// QString filePath = fileNameFromUrl( path );
if ( favoriteSet->find( path ) != favoriteSet->end() ) if ( favoriteSet->find( path ) != favoriteSet->end() )
{ {
favoriteSet->erase( favoriteSet->find( path ) ); favoriteSet->erase( favoriteSet->find( path ) );
...@@ -622,7 +620,6 @@ void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManu ...@@ -622,7 +620,6 @@ void UBFeaturesController::removeFromFavorite( const QUrl &path, bool deleteManu
QString UBFeaturesController::fileNameFromUrl( const QUrl &url ) QString UBFeaturesController::fileNameFromUrl( const QUrl &url )
{ {
QString fileName = url.toString(); QString fileName = url.toString();
//if ( fileName.contains( "uniboardTool://"))
if ( fileName.contains( "OpenboardTool://")) if ( fileName.contains( "OpenboardTool://"))
return fileName; return fileName;
return url.toLocalFile(); return url.toLocalFile();
...@@ -633,7 +630,6 @@ UBFeatureElementType UBFeaturesController::fileTypeFromUrl(const QString &path) ...@@ -633,7 +630,6 @@ UBFeatureElementType UBFeaturesController::fileTypeFromUrl(const QString &path)
{ {
QFileInfo fileInfo(path); QFileInfo fileInfo(path);
//if ( path.contains("uniboardTool://"))
if ( path.contains("OpenboardTool://")) if ( path.contains("OpenboardTool://"))
return FEATURE_INTERNAL; return FEATURE_INTERNAL;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#ifndef UB_H_ #ifndef UB_H_
#define UB_H_ #define UB_H_
//#include <QtGui>
#include <QtWidgets> #include <QtWidgets>
...@@ -46,7 +45,6 @@ struct UBMimeType ...@@ -46,7 +45,6 @@ struct UBMimeType
Audio, Audio,
Flash, Flash,
PDF, PDF,
//UniboardTool,
OpenboardTool, OpenboardTool,
Group, Group,
UNKNOWN UNKNOWN
......
...@@ -183,20 +183,18 @@ UBApplication::~UBApplication() ...@@ -183,20 +183,18 @@ UBApplication::~UBApplication()
QString UBApplication::checkLanguageAvailabilityForSankore(QString &language) QString UBApplication::checkLanguageAvailabilityForSankore(QString &language)
{ {
QStringList availableTranslations = UBPlatformUtils::availableTranslations(); QStringList availableTranslations = UBPlatformUtils::availableTranslations();
//QStringList availableTranslations ;availableTranslations<< "OpenBoard_fr";
if(availableTranslations.contains(language,Qt::CaseInsensitive)) if(availableTranslations.contains(language,Qt::CaseInsensitive))
return language; return language;
else{ else{
if(language.length() > 2){ if(language.length() > 2){
QString shortLanguageCode = language.left(2); QString shortLanguageCode = language.left(2);
//if(availableTranslations.contains(shortLanguageCode,Qt::CaseInsensitive))
foreach (const QString &str, availableTranslations) { foreach (const QString &str, availableTranslations) {
if (str.contains(shortLanguageCode)) if (str.contains(shortLanguageCode))
return shortLanguageCode; return shortLanguageCode;
} }
//if(availableTranslations.contains(shortLanguageCode))
//return shortLanguageCode;
} }
} }
return QString(""); return QString("");
......
...@@ -28,13 +28,10 @@ ...@@ -28,13 +28,10 @@
#ifndef UBAPPLICATIONCONTROLLER_H_ #ifndef UBAPPLICATIONCONTROLLER_H_
#define UBAPPLICATIONCONTROLLER_H_ #define UBAPPLICATIONCONTROLLER_H_
//#include <QtGui>
#include <QtWidgets> #include <QtWidgets>
#include <QtNetwork> #include <QtNetwork>
//#include <QFtp>
//#include <QHttpResponseHeader>
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
...@@ -55,7 +52,6 @@ class UBSoftwareUpdate; ...@@ -55,7 +52,6 @@ class UBSoftwareUpdate;
class QNetworkAccessManager; class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class QHttpPart; class QHttpPart;
//class QHttp;
class UBRightPalette; class UBRightPalette;
class UBOpenSankoreImporter; class UBOpenSankoreImporter;
class QScriptValue; class QScriptValue;
...@@ -161,7 +157,6 @@ class UBApplicationController : public QObject ...@@ -161,7 +157,6 @@ class UBApplicationController : public QObject
private slots: private slots:
void updateRequestFinished(int id, bool error); void updateRequestFinished(int id, bool error);
//void updateHeaderReceived(QHttpResponseHeader header);
void updateHeaderReceived(QNetworkRequest header ); void updateHeaderReceived(QNetworkRequest header );
protected: protected:
......
...@@ -114,16 +114,16 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte ...@@ -114,16 +114,16 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
Delegate()->createControls(); Delegate()->createControls();
if (mediaType_Audio == mMediaType) if (mediaType_Audio == mMediaType)
Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::ResizingHorizontally); Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::ResizingHorizontally);
else else {
Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing); Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);
// Resize the widget as soon as the video's native size is known (it isn't at this stage)
connect(mVideoItem, SIGNAL(nativeSizeChanged(QSizeF)), this, SLOT(resize(QSizeF)));
}
setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly
connect(Delegate(), SIGNAL(showOnDisplayChanged(bool)), this, SLOT(showOnDisplayChanged(bool))); connect(Delegate(), SIGNAL(showOnDisplayChanged(bool)), this, SLOT(showOnDisplayChanged(bool)));
connect(mMediaObject, SIGNAL(videoAvailableChanged(bool)), this, SLOT(hasMediaChanged(bool))); connect(mMediaObject, SIGNAL(videoAvailableChanged(bool)), this, SLOT(hasMediaChanged(bool)));
// Resize the widget as soon as the video's native size is known (it isn't at this stage)
connect(mVideoItem, SIGNAL(nativeSizeChanged(QSizeF)), this, SLOT(resize(QSizeF)));
} }
......
...@@ -57,15 +57,6 @@ void UBPlatformUtils::init() ...@@ -57,15 +57,6 @@ void UBPlatformUtils::init()
{ {
initializeKeyboardLayouts(); initializeKeyboardLayouts();
// qwidget_mac.mm qt_mac_set_fullscreen_mode uses kUIModeAllSuppressed which is unfortunate in our case
//
// http://developer.apple.com/mac/library/documentation/Carbon/Reference/Dock_Manager/Reference/reference.html#//apple_ref/c/func/SetSystemUIMode
//
//originalSetSystemUIMode = APEPatchCreate((const void *)SetSystemUIMode, (const void *)emptySetSystemUIMode);
//setDesktopMode(false);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *currentPath = [[NSBundle mainBundle] pathForResource:@"Save PDF to OpenBoard" ofType:@"workflow"]; NSString *currentPath = [[NSBundle mainBundle] pathForResource:@"Save PDF to OpenBoard" ofType:@"workflow"];
...@@ -94,8 +85,6 @@ void UBPlatformUtils::init() ...@@ -94,8 +85,6 @@ void UBPlatformUtils::init()
void UBPlatformUtils::setDesktopMode(bool desktop) void UBPlatformUtils::setDesktopMode(bool desktop)
{ {
//qDebug() << "setDesktopMode called. desktop = " << desktop;
@try { @try {
// temporarily disabled due to bug: when switching to desktop mode (and calling this), // temporarily disabled due to bug: when switching to desktop mode (and calling this),
// openboard switches right back to the board mode. clicking again on desktop mode works. // openboard switches right back to the board mode. clicking again on desktop mode works.
......
...@@ -60,7 +60,6 @@ UBFloatingPalette::UBFloatingPalette(Qt::Corner position, QWidget *parent) ...@@ -60,7 +60,6 @@ UBFloatingPalette::UBFloatingPalette(Qt::Corner position, QWidget *parent)
#endif #endif
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_MacAlwaysShowToolWindow);
//setAttribute(Qt::WA_MacNonActivatingToolWindow); // no longer exists
setAttribute(Qt::WA_MacNoShadow); setAttribute(Qt::WA_MacNoShadow);
#endif #endif
} }
......
...@@ -85,7 +85,6 @@ UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive) ...@@ -85,7 +85,6 @@ UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive)
#endif #endif
#ifdef Q_OS_OSX #ifdef Q_OS_OSX
setAttribute(Qt::WA_MacAlwaysShowToolWindow); setAttribute(Qt::WA_MacAlwaysShowToolWindow);
//setAttribute(Qt::WA_MacNonActivatingToolWindow);
setAttribute(Qt::WA_MacNoShadow); setAttribute(Qt::WA_MacNoShadow);
#endif #endif
} }
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
//#include <QGraphicsPolygonItem>
#include <QPolygonF> #include <QPolygonF>
#include <QtWidgets/QGraphicsPolygonItem> #include <QtWidgets/QGraphicsPolygonItem>
...@@ -143,7 +141,6 @@ void UBGraphicsTriangle::setOrientation(UBGraphicsTriangleOrientation orientatio ...@@ -143,7 +141,6 @@ void UBGraphicsTriangle::setOrientation(UBGraphicsTriangleOrientation orientatio
{ {
mOrientation = orientation; mOrientation = orientation;
//calculatePoints(boundingRect());
calculatePoints(bounds_rect); calculatePoints(bounds_rect);
QPolygonF polygon; QPolygonF polygon;
...@@ -172,7 +169,6 @@ UBGraphicsScene* UBGraphicsTriangle::scene() const ...@@ -172,7 +169,6 @@ UBGraphicsScene* UBGraphicsTriangle::scene() const
void UBGraphicsTriangle::calculatePoints(const QRectF& r) void UBGraphicsTriangle::calculatePoints(const QRectF& r)
{ {
//qDebug() << "UBGraphicsTriangle calculatePoints()"<<"r ="<<r<<"mOrientation ="<<mOrientation;
switch(mOrientation) switch(mOrientation)
{ {
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#ifndef UBGRAPHICSTRIANGLE_H_ #ifndef UBGRAPHICSTRIANGLE_H_
#define UBGRAPHICSTRIANGLE_H_ #define UBGRAPHICSTRIANGLE_H_
//#include <QtGui>
#include <QtWidgets> #include <QtWidgets>
#include <QtSvg> #include <QtSvg>
......
...@@ -49,7 +49,6 @@ void UBToolsManager::destroy() ...@@ -49,7 +49,6 @@ void UBToolsManager::destroy()
UBToolsManager::UBToolsManager(QObject *parent) UBToolsManager::UBToolsManager(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
//mask.id = "uniboardTool://uniboard.mnemis.com/mask";
mask.id = "openboardtool://openboard/mask"; mask.id = "openboardtool://openboard/mask";
mask.icon = QPixmap(":/images/toolPalette/maskTool.png"); mask.icon = QPixmap(":/images/toolPalette/maskTool.png");
...@@ -58,7 +57,6 @@ UBToolsManager::UBToolsManager(QObject *parent) ...@@ -58,7 +57,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(mask.id, ":/images/toolPalette/maskTool.png"); mToolsIcon.insert(mask.id, ":/images/toolPalette/maskTool.png");
mDescriptors << mask; mDescriptors << mask;
//ruler.id = "uniboardTool://uniboard.mnemis.com/ruler";
ruler.id = "openboardtool://ruler"; ruler.id = "openboardtool://ruler";
ruler.icon = QPixmap(":/images/toolPalette/rulerTool.png"); ruler.icon = QPixmap(":/images/toolPalette/rulerTool.png");
...@@ -67,7 +65,6 @@ UBToolsManager::UBToolsManager(QObject *parent) ...@@ -67,7 +65,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(ruler.id, ":/images/toolPalette/rulerTool.png"); mToolsIcon.insert(ruler.id, ":/images/toolPalette/rulerTool.png");
mDescriptors << ruler; mDescriptors << ruler;
//compass.id = "uniboardTool://uniboard.mnemis.com/compass";
compass.id = "openboardtool://compass"; compass.id = "openboardtool://compass";
compass.icon = QPixmap(":/images/toolPalette/compassTool.png"); compass.icon = QPixmap(":/images/toolPalette/compassTool.png");
...@@ -76,7 +73,6 @@ UBToolsManager::UBToolsManager(QObject *parent) ...@@ -76,7 +73,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(compass.id, ":/images/toolPalette/compassTool.png"); mToolsIcon.insert(compass.id, ":/images/toolPalette/compassTool.png");
mDescriptors << compass; mDescriptors << compass;
//protractor.id = "uniboardTool://uniboard.mnemis.com/protractor";
protractor.id = "openboardtool://protractor"; protractor.id = "openboardtool://protractor";
protractor.icon = QPixmap(":/images/toolPalette/protractorTool.png"); protractor.icon = QPixmap(":/images/toolPalette/protractorTool.png");
...@@ -85,7 +81,6 @@ UBToolsManager::UBToolsManager(QObject *parent) ...@@ -85,7 +81,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(protractor.id,":/images/toolPalette/protractorTool.png"); mToolsIcon.insert(protractor.id,":/images/toolPalette/protractorTool.png");
mDescriptors << protractor; mDescriptors << protractor;
//triangle.id = "uniboardTool://uniboard.mnemis.com/triangle";
triangle.id = "openboardtool://triangle"; triangle.id = "openboardtool://triangle";
triangle.icon = QPixmap(":/images/toolPalette/triangleTool.png"); triangle.icon = QPixmap(":/images/toolPalette/triangleTool.png");
...@@ -94,7 +89,6 @@ UBToolsManager::UBToolsManager(QObject *parent) ...@@ -94,7 +89,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(triangle.id,":/images/toolPalette/triangleTool.png"); mToolsIcon.insert(triangle.id,":/images/toolPalette/triangleTool.png");
mDescriptors << triangle; mDescriptors << triangle;
//magnifier.id = "uniboardTool://uniboard.mnemis.com/magnifier";
magnifier.id = "openboardtool://magnifier"; magnifier.id = "openboardtool://magnifier";
magnifier.icon = QPixmap(":/images/toolPalette/magnifierTool.png"); magnifier.icon = QPixmap(":/images/toolPalette/magnifierTool.png");
...@@ -103,7 +97,6 @@ UBToolsManager::UBToolsManager(QObject *parent) ...@@ -103,7 +97,6 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(magnifier.id,":/images/toolPalette/magnifierTool.png"); mToolsIcon.insert(magnifier.id,":/images/toolPalette/magnifierTool.png");
mDescriptors << magnifier; mDescriptors << magnifier;
//cache.id = "uniboardTool://uniboard.mnemis.com/cache";
cache.id = "openboardtool://cache"; cache.id = "openboardtool://cache";
cache.icon = QPixmap(":/images/toolPalette/cacheTool.png"); cache.icon = QPixmap(":/images/toolPalette/cacheTool.png");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment