Skip to content

Commit

Permalink
Drop some cyclic #include's of structs.h
Browse files Browse the repository at this point in the history
It should reduce compile times.
Related to #174.
  • Loading branch information
leha-bot committed Jul 24, 2019
1 parent ed447e9 commit a2ec3a2
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Telegram/SourceFiles/data/data_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

#include "data/data_types.h"

class PhotoData;
class DocumentData;

struct GameData {
GameData(const GameId &id)
: id(id) {}
Expand Down
1 change: 1 addition & 0 deletions Telegram/SourceFiles/data/data_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <qglobal.h>
#include <QPair>
#include "core/utils.h" // TimeMs and stuff

using VideoId = quint64;
using AudioId = quint64;
Expand Down
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/history/history.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
#include "dialogs/dialogs_common.h" // For Dialogs::Mode
#include "ui/animation.h" // For BasicAnimation
#include "ui/effects/send_action_animations.h" // For SendActionAnimation
#include "ui/text/text.h"
#include "data/data_photo.h"
#include "data/data_game.h"
#include "structs.h"

void HistoryInit();

Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/history/history_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

#include "base/flags.h"
#include "base/runtime_composer.h"
#include "core/basic_types.h"
#include "core/click_handler.h"
#include "history/history.h"
#include "structs.h"
#include "ui/animation.h"
#include "ui/text/text.h"

Expand All @@ -40,6 +40,7 @@ struct RippleAnimation;
} // namespace style

class HistoryItem;
class History;

class HistoryElement {
public:
Expand Down
6 changes: 5 additions & 1 deletion Telegram/SourceFiles/inline_bots/inline_bot_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
//
#include "inline_bots/inline_bot_result.h"

#include "app.h"
#include "core/file_utilities.h"
#include "data/data_game.h"
#include "inline_bots/inline_bot_layout_item.h"
#include "inline_bots/inline_bot_send_data.h"
#include "mainwidget.h"
Expand Down Expand Up @@ -188,7 +190,9 @@ std::unique_ptr<Result> Result::create(quint64 queryId, const MTPBotInlineResult
}
} break;

default: { badAttachment = true; } break;
default: {
badAttachment = true;
} break;
}

if (badAttachment || !result->sendData || !result->sendData->isValid()) {
Expand Down
8 changes: 7 additions & 1 deletion Telegram/SourceFiles/inline_bots/inline_bot_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@
#pragma once

#include "core/basic_types.h"
#include "structs.h"
#include "data/data_types.h"
#include "ui/images.h"
#include "scheme.h"

class FileLoader;
class History;
class LocationCoords;
class DocumentData;
class PhotoData;

struct GameData;

namespace InlineBots {

Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/inline_bots/inline_bot_send_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
// Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
// Copyright (c) 2017- Kepka Contributors, https://github.com/procxx
//
#include "inline_bots/inline_bot_send_data.h"
#include "app.h"
#include "data/data_game.h"
#include "inline_bots/inline_bot_send_data.h"
#include "inline_bots/inline_bot_result.h"
#include "lang/lang_keys.h"
#include "storage/localstorage.h"
Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/inline_bots/inline_bot_send_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
#pragma once

#include "core/basic_types.h"
#include "data/data_types.h"
#include "history/history_location_manager.h"
#include "mtproto/type_utils.h"
#include "structs.h"

struct GameData;
class History;
namespace InlineBots {

Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/ui/effects/send_action_animations.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
//
#pragma once

#include "structs.h"
#include "data/data_types.h"
#include "ui/twidget.h"

namespace Ui {

Expand Down

0 comments on commit a2ec3a2

Please sign in to comment.